Question about DoCmd.RUNSQL using an insert statem
Today is my first daying using access & VB6.0, and Im working with some visual basic 6.0 code.
Im trying to do a simple Insert for one of the tables that I have created, here is the code Im using:
Private Sub Command51_Click()
On Error GoTo Err_Command51_Click
DoCmd.RunSQL "Insert into test(nameF, nameL) values(me.firstname,me.lastname)"
DoCmd.GoToRecord , , acNewRec
Exit_Command51_Click:
Exit Sub
Err_Command51_Click:
MsgBox Err.Description
Resume Exit_Command51_Click
End Sub
For some reason, when I click on the button thats supposed to activate this piece of code, It displays an message box asking me to input the "me.firstname" and another box for the "me.lastname"..... Those 2 fields (first and last name) are enterable fields that I have created in one of my forms. Can someone help me out plz
thanks
|