Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ComboBox to Get data

Status
Not open for further replies.

computergeek

Programmer
May 23, 2001
193
CA
Hi,

I have a combobox which contains a list of Companys. (Selects company_name from company table) After the user selects the company I want to retreive the other data within the company table (email, fax, address etc.) and default a number of fields on the entry form.

Sorry, I haven't done any MSAccess programming in a looonng time...

Thanks in advance for the information,

Computergeek
 
Hey Computergeek,

One way that you could accomplish what your asking to do is to add those fields to your cboBox and set their field widths to 0 (if you didn't want them to show in the cboBox) then in the cboBox's AfterUpdate event you could have the different columns refer to unbound text boxes (or bound) on your form. Access starts counting the columns at zero so for example:

address is in 2nd column from the left and the fax is in the third column from the left so your AfterUpdate code could go something like this:

Me.TextBox1 = Me.cboName.Column(1) 'for address
Me.TextBox2 = Me.cboName.Column(2) 'fax

HTH,
Shane






 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top