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

store combobox value in form to table

Status
Not open for further replies.

benbakelaar

IS-IT--Management
Jan 6, 2004
12
0
0
US
i have a form that has two combo boxes, one selects a students name, the other selects a course name. i need to have a user click at the end of the form and store those selected values to a course registration table. i am familiar with access but do not know how to reference the table inside the VBA procedure. i have the "save" button and a blank procedure ready, but i am not sure which command to use to send/store the values into the table.
 
ok, i realize this was a very beginner question. i had tried searching around the forums but i did not even know what i was looking for. anyway i figured out to use an SQL statement, and got that working. however, after successfully executing, access gives me an "object required" error, even though it updates the table. here is my code, any help please?

//code

Dim SQL As String
SQL = "INSERT INTO courseReg (SSN, courseID) VALUES (Combo14, Combo16)"

DoCmd.RunSQL SQL
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top