SQL inserting into a table

I

iwasinnihon

I have information chosen on the form from combo boxes. These combo
boxes receive their information from other tables. What I need to do
is take in the information entered in those boxes and insert certain
information into a 3rd table. That in itself, I believe is pretty
straight forward. The part I am having trouble with is the following.
The first combo box lists the description of the item. I need to
lookup the Item number for that description and insert the number into
my 3rd table. I am having difficulty writing the SQL for this. Please
help me.

Thanks for all the help that has been given to me so far.
 
K

kingston via AccessMonster.com

Can you change the combobox to hold both the ItemID and the ItemDescription?
IOW, make a multi-column combobox and hide the ID column if you need to by
making its width 0". Then you can reference the ItemID via something like Me.
ComboBox.Column(0) and create an insert query like this:

stringSQL = "INSERT INTO Table(Field) SELECT " & Me.ComboBox.Column(0) & " AS
ItemID;"
DoCmd.RunSQL stringSQL
 
Top