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

Data entry from a form's combobox selection

Status
Not open for further replies.

JimboSHU

Technical User
Dec 23, 2002
15
US
What I want to do is populate a form with the data of one table through the use of a combobox and after doing so be able to click a command button that would add that data to a record in another table. Any Ideas?
 
Use the combo on the form as a selector to identify the record you want, once you have the correct record use a Save button with code to open the second table and write the form detail to the table.

In cmdSave_Click()
Dim rst as recordset
Set rst = CurrentDb.OpenRecordset("TableNum2")
rst.AddNew
rst!Field1 = Me!Field1
rst!Field2 = Me!Field2
etc..
etc..
rst.Update
rst.Close
Set rst = Nothing

 
I keep on getting a Runtime error with a type mismatch on the first set rst line. Why would that be? I replaced TableNum2 with the appropriate table
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top