I am attempting to add data to a table through a form. The fields I am displaying in combo boxes are bound to fields that are setup as AutoNumber Fields.
I am attempting to run the following SQL statment to update a specific table:
Dim User As Long, Category As Long, Skill As Long, Level As Long
Dim Using As Long, Last As Long
User = Me.Combo134
Category = Me.Combo120
Skill = Me.Combo116
Level = Me.Combo126
Using = Me.Combo128
Last = Me.Combo130
strSQL1 = "insert into Employee_Skill_Data (UserID, Category_ID, SkillID, Skill_Level, TimeID, LastUsedID) VALUES (& User &, & Category &, & Skill &, & Level &, & Using &, & Last &);"
DoCmd.GoToRecord , , acNewRec
All I get back is a Type Mismatch error.
Can anyone see what I am doing wrong? Any help I can get would be helpful.
If you link the table to the form (using the forms RecordSource property), there is no need to have any code to update the form, the work will be done for you automatically. Provided the combo boxes are linked to the relevant fields in the form (via their ControlSource property)