By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,097 Members | 1,405 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,097 IT Pros & Developers. It's quick & easy.

Textbox retrieving multiple values

P: 16
Hello,

I need help in VB.NET.
I'm developing an asset management application.
assets have different types (Computer), and a label initial for this type (PC).

When the user wants to add an asset, he/she should select the type name (Computer) from a dropdownlist and the textbox that is under that dropdownlist will show the label initial (PC).

What I want the program to do is display automatically PC + the number of assets added for that specific type. (PC0001) if it was the 1st computer added and (PC0002) for the 2nd ..etc.

Note that the asset label initial and the asset number = label number which is the primary key of the asset table.

I managed to retreive the label initial into the textbox. But how can I add the number of that asset for each asset type? Should there be a property in the database to hold this value?

Solving this would make things very much easier. I would really appreciate if some one would help :)
Mar 15 '07 #1
Share this Question
Share on Google+
1 Reply


vijaydiwakar
100+
P: 579
Hello,

I need help in VB.NET.
I'm developing an asset management application.
assets have different types (Computer), and a label initial for this type (PC).

When the user wants to add an asset, he/she should select the type name (Computer) from a dropdownlist and the textbox that is under that dropdownlist will show the label initial (PC).

What I want the program to do is display automatically PC + the number of assets added for that specific type. (PC0001) if it was the 1st computer added and (PC0002) for the 2nd ..etc.

Note that the asset label initial and the asset number = label number which is the primary key of the asset table.

I managed to retreive the label initial into the textbox. But how can I add the number of that asset for each asset type? Should there be a property in the database to hold this value?

Solving this would make things very much easier. I would really appreciate if some one would help :)
try this code

Expand|Select|Wrap|Line Numbers
  1.  
  2. Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As _
  3. System.EventArgs) Handles MyBase.Load
  4.  
  5.    ComboBox1.Items.Add("Nancy Davolio")
  6.    Microsoft.VisualBasic.Compatibility.VB6. _
  7.       SetItemData(ComboBox1, ComboBox1.Items.Count() - 1, 12345)
  8.  
  9.    ComboBox1.Items.Add("Judy Phelps")
  10.    Microsoft.VisualBasic.Compatibility.VB6. _
  11.       SetItemData(ComboBox1, ComboBox1.Items.Count() - 1, 67890)
  12. End Sub
  13.  
  14.  
  15. Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, _
  16. ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
  17.  
  18.    Label1.Text = "Employee #" & CStr( _
  19.    Microsoft.VisualBasic.Compatibility.VB6. _
  20.       GetItemData(ComboBox1, ComboBox1.SelectedIndex))
  21. End Sub
  22.  
try it
:)
Mar 15 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.