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!

Need combobox selection to update to another table

Status
Not open for further replies.

platypus71

Technical User
Sep 7, 2005
68
US
I have a form with a combobox in it that works as expected. I can select a record from the box and the drop-down goes away.

I have created a button next to the box that I want to append the record from the drop-down box to a new table, but can't seem to make it only send a single record.

Any help here would be appreciated.
Chris
 
It is nearly always a good idea to post a little code.
 
I understand that, but what code can I post from a form that would be helpful beyond the description.

I have my row source for the ComboBox set as:
Code:
SELECT DISTINCT CurrentMonth.[Reporting Level 3] FROM CurrentMonth ORDER BY [Reporting Level 3];

This provides a list to pick from. I want the button on the page to then take the value from the drop down box that is selected and Append it to tblLevel3s upon click. I only want that field to be appended to the table, none other, but have yet to get anything that even remotely looks like it worked. Posting what has failed, though it may provide humor value, would be irrelavant examples.
 
A starting point (VBA code):
Code:
CurrentDb.Execute "INSERT INTO tblLevel3s ([field name]) VALUES('" & Me![combo name] & "')")

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
I am very weak in VB code and use macros whenever possible.

I have been playing with the 'setvalue' field in a macro and believe I have it, but it is now erasing the selection from the combobox.
 
How a SetValue macro would append something to a table ?
 
SetValue assigns the data to a field.
Then an append query to append to a table upon clicking the 'add' button.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top