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

Inserting into a table using a Add new form 1

Status
Not open for further replies.

kavita11

Programmer
Oct 27, 2001
32
US
I have a combo box with a list of values coming from the Row source - a Select query. The list is

Installed
Retired
Good
Damaged

Refering to the status of equipment. I have an Equipment type table which stores a code like 1 for Installed and 2 for Retired and so on. I have created a Add new Form where a user is trying to insert data into a table called Equipment and using the drop down they pick the status. The problem is I want to insert the Equipment ID from the Equipment type table and not the text. I am terribly rusty with VB right now and cannot think. I am working in VB Access 2000.I have taken off the control source to the drop down field and I was thinking of using a hidden field to populate the code and tie this to the Equipment table.

Thanks

K
 
Hi
This might work if the data for your combobox looks like (eg)
1 Installed
2 Retired
3 Good
4 Damaged
Then the combo box could have bound column= 1, column count= 2, column widths=0 cm; 2 cm
Which would mean that the data displayed would be text, but the data saved would be the number. [ponder]

 
Thanks a ton that worked great. Do you know of any good website for syntax reference for VB?

thanks

K
 
Glad to help. Can't say I do. I have generally struggled through the MSDN library, but I'm sure someone will post a good site.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top