I am new to Access. I have made a form to put the data in the table. I have one one combo box and one text box in the userform.
Below is my code:
Private Sub add_Click()
'Add Data to the GroupHeads Table
CurrentDb.Execute "Insert into GroupHeads(AccountHeads, GroupHeads)" & " Values(" & Me.cboaccounthead & ", '" & Me.txtgrouphead & "')"
End Sub
Please review and advise why its giving runtime error.
Regards. Salman
AccountHeads
column is a numeric data type? Finally watch forMe.cboaccounthead
containing quote characters as this will break theinsert
statement - you might need to wrapMe.cboaccounthead
inside aReplace
function. – Skippy