944,082 Members | Top Members by Rank

Ad:
  • VB.NET Discussion Thread
  • Unsolved
  • Views: 3857
  • VB.NET RSS
Oct 25th, 2006
0

combobox question

Expand Post »
Hi there,

i need some help as i'm new with using comboboxes

i have a table in a MS access database named "CUSTOMER" and in my vb form i have a combobox (name: cmb1). I want to display the names of my customers in my combobox when the form loads and when i search the combobox and select a particular person, i want the other values in the table to be displayed in textboxes......

any ideas please??? thank you very much
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
lukis is offline Offline
14 posts
since Oct 2006
Oct 26th, 2006
0

Re: combobox question

hi
select cobobox and in right you will see the properties
1/datasource make its value the table in dataset you want
2/ ValueMember make its value the coulmn name (name of custeomer)

when your form load you fill dataset
VB.NET Syntax (Toggle Plain Text)
  1. Me.DataSet11.Clear()
  2. Me.OleDbDataAdapter1.Fill(DataSet11)

now the list of comboBox has the names of ur customers

i hope this help
Reputation Points: 37
Solved Threads: 17
Junior Poster
manal is offline Offline
122 posts
since Mar 2006
Oct 26th, 2006
0

Re: combobox question

hi and thanks for your reply. however i have been able to do that fill. my query is this.

I have 3 textboxes on my form.
when i select the item from the combobox i need the 3 textboxes to be filled with the data corresponding to that field. ( what i'm trying to say is that i have a table in macces with 4 rows, one of them is the field chosen in the combobox. now when i select the item i want the textboxes to display the latter of the record)

thanks
lukis
Reputation Points: 10
Solved Threads: 0
Newbie Poster
lukis is offline Offline
14 posts
since Oct 2006
Oct 26th, 2006
0

Re: combobox question

hi:cheesy:
i used dataset and dataadptor for display the other data in text box
the sql query will be like this

VB.NET Syntax (Toggle Plain Text)
  1. select email , name
  2. from customer
  3. where id =?

then douple click in combobox and write this code (douple click means the code will excute when user select value )

VB.NET Syntax (Toggle Plain Text)
  1. 'here you select the row from table with id that user choose from comboBox
  2. OleDbDataAdapter2.SelectCommand.Parameters("ID").Value = Me.ComboBox1.Text
  3.  
  4. Me.DataSet21.Clear()
  5. Me.OleDbDataAdapter2.Fill(DataSet21)
  6.  
  7. TextBox1.Text = DataSet21.Tables("customer").Rows(0).Item("email")
  8.  
  9. TextBox2.Text = DataSet21.Tables("customer").Rows(0).Item("name")


i hope this what u want

manal
Reputation Points: 37
Solved Threads: 17
Junior Poster
manal is offline Offline
122 posts
since Mar 2006
Oct 28th, 2006
0

Re: combobox question

thanks. listen i found this code but it's in c#... i need something that is exactly like this....but in vb.net 2003......

http://www.codeproject.com/csharp/combobox.asp

please help me thank you for your co-operation
Reputation Points: 10
Solved Threads: 0
Newbie Poster
lukis is offline Offline
14 posts
since Oct 2006
Nov 3rd, 2006
0

Re: combobox question

guys imagine i have this table

Rest_type Rest_name Tel Location
----------- ------------ --- ----------

ala carte del pinto 2345546 Dublin
pizzeria francesco's 3455667 Rome




now i have a form with a combobox (cbRests), and 2 textboxes (txtType, txtTel)

i have been able to include the Rest_name in the combobox but i need to fill in the textboxes with the relevant info...ex

when i select del pinto from the combobox, i want the textboxes to display ala carte and 2345546....how can i do that......in code please as i have no idea on how to do that.... thank you very much...your help is very much needed here
Reputation Points: 10
Solved Threads: 0
Newbie Poster
lukis is offline Offline
14 posts
since Oct 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in VB.NET Forum Timeline: how to connect access with vb.net
Next Thread in VB.NET Forum Timeline: Suggestions Please (database)





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC