Here is the code I have for this form I'm working on. In the strSQL I get a compile error that says "Expected: End of statement". The INTO word is highlighted, if I remove everything after INSERT I don't get an error but that does me no good.
Private Sub Form_BeforeUpdate(Cancel As Integer)
On Error GoTo Err_Form_Update
Dim strNotes As String
Dim strSQL As String
strSQL = INSERT INTO [Patient Notes] ([customer_id], [Notes], [Timestamp], [Initials]) VALUES ([me]![customer_id], strNotes, now(), currentuser)
strNotes = InputBox("Please enter what changes you made", "Update Record"
DoCmd.RunSQL strSQL
Exit_Form_Update:
Exit Sub
Err_Form_Update:
MsgBox Err.Description
Resume Exit_Form_Update
End Sub
On this main form (frmPatients)is a subform (Patient Notes Subform). When the record is updated I want the program to insert a new record in the "Patient Notes" table with whatever they put in the input box, timestamp is automatic, and initials using the currentuser() function, and customer ID populating from the customer id currently on the form. Any help would be greatly appriciated. I am using Access 2000.
Private Sub Form_BeforeUpdate(Cancel As Integer)
On Error GoTo Err_Form_Update
Dim strNotes As String
Dim strSQL As String
strSQL = INSERT INTO [Patient Notes] ([customer_id], [Notes], [Timestamp], [Initials]) VALUES ([me]![customer_id], strNotes, now(), currentuser)
strNotes = InputBox("Please enter what changes you made", "Update Record"
DoCmd.RunSQL strSQL
Exit_Form_Update:
Exit Sub
Err_Form_Update:
MsgBox Err.Description
Resume Exit_Form_Update
End Sub
On this main form (frmPatients)is a subform (Patient Notes Subform). When the record is updated I want the program to insert a new record in the "Patient Notes" table with whatever they put in the input box, timestamp is automatic, and initials using the currentuser() function, and customer ID populating from the customer id currently on the form. Any help would be greatly appriciated. I am using Access 2000.