A
Alan Holroyd via AccessMonster.com
Hi,
I hope I have posted this in the correct place.
I am trying to insert data from a current form into a table i've used the
following code behind a on click event
Private Sub Command10_Click()
On Error GoTo Err_Command10_Click
Dim SQL As String
Dim cntID As Integer
cntID = Me.ContactID
SQL = "INSERT INTO Contacted(ContactID) VALUES (cntID)"
DoCmd.RunSQL SQL
Exit_Command10_Click:
Exit Sub
Err_Command10_Click:
MsgBox Err.Description
Resume Exit_Command10_Click
End Sub
I get a dialog box appear requesting that I eneter the value for cntID, I
have tried to set the value for cntID (should equal me.ContactID) using the
code. What have I done wrong can anyone help, please
I hope I have posted this in the correct place.
I am trying to insert data from a current form into a table i've used the
following code behind a on click event
Private Sub Command10_Click()
On Error GoTo Err_Command10_Click
Dim SQL As String
Dim cntID As Integer
cntID = Me.ContactID
SQL = "INSERT INTO Contacted(ContactID) VALUES (cntID)"
DoCmd.RunSQL SQL
Exit_Command10_Click:
Exit Sub
Err_Command10_Click:
MsgBox Err.Description
Resume Exit_Command10_Click
End Sub
I get a dialog box appear requesting that I eneter the value for cntID, I
have tried to set the value for cntID (should equal me.ContactID) using the
code. What have I done wrong can anyone help, please