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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combo Box - two values required for database 1

Status
Not open for further replies.

rexrivas

Technical User
Apr 19, 2004
20
US
I have a form that contains a combo box. This combo box displays 2 fields : 1) Vendor name 2) Vendor Number. User make the selection by name and the form stores value for vendor number in the database.

I actually need both fields to store in the database. Can this be done within a combo box properties or do i need another method
 
Add another field to the table/form to store the 2nd value.

Make it invisible/visible on your form, whatever is best for your interface.

In the On Change event of the Combo Box set the new field's value to the value of the 2nd column of the combo box (or to the value of the column that holds the data you need to have stored).

In the On Change event of your combo box, enter something like this:

Me.YourNewField.Value = Me!YourCombo.Column(1)

It looks like it's referencing the 1st column, but the 1st column reference starts at column(0). So, column(1) is really referencing the 2nd column, column(2) the 3rd, and so on.

Make sure your new field is bound to your table so it has somewhere to store the data.

Hope this helps.
 
cghoga, it works perfectly thanks very mucho
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top