Jencylivez
08-10-2009, 03:47 PM
Good evening,
Does anyone see anything wrong with the santax below? I keep on getting an SQL santax error and I've tried everything.
Private Sub Command2_Click()
Dim CurrentUser As String
Dim UserIntl As String
CurrentUser = fOSUserName()
UserIntl = DLookup("[Initials]", "Users", "[ComputerUserName] = " & "'" & CurrentUser & "'")
'Send Email
SendMail
DoCmd.RunSQL "INSERT INTO tblCallNotes (ContactID, ContactNote,CallTime,CallMadeBy,) VALUES ('" & Me.txtContactID & "', '" & Me.txtEmailBox & "' ,#" & Now() & "#,'" & UserIntl & "');"
End Sub
Does anyone see anything wrong with the santax below? I keep on getting an SQL santax error and I've tried everything.
Private Sub Command2_Click()
Dim CurrentUser As String
Dim UserIntl As String
CurrentUser = fOSUserName()
UserIntl = DLookup("[Initials]", "Users", "[ComputerUserName] = " & "'" & CurrentUser & "'")
'Send Email
SendMail
DoCmd.RunSQL "INSERT INTO tblCallNotes (ContactID, ContactNote,CallTime,CallMadeBy,) VALUES ('" & Me.txtContactID & "', '" & Me.txtEmailBox & "' ,#" & Now() & "#,'" & UserIntl & "');"
End Sub