sql syntax error

From: JohnE (JohnE_at_discussions.microsoft.com)
Date: 10/11/04


Date: Mon, 11 Oct 2004 11:33:04 -0700

I am getting a syntax error from the following;
        Dim strSQL As String
        Dim MyTime
        MyTime = Time
            strSQL = "INSERT INTO
tblWhoLoggedOn(UserName,UserPassword,Date,Time) " & _
                " VALUES (" & Me.cboUserName & "," & Me.txtUserPassword &
",Now(),MyTime)"
            CurrentDb.Execute strSQL, dbFailOnError

I am wanting to track those who sign into the db. When the error comes up,
it highlites the last line (CurrentDb...).
Can anyone see the mistake made in this?
Thanks in advance to anyone who responds.
*** John



Relevant Pages

  • Re: [PHP] problem with INSERT query
    ... DB Error: syntax error ... well, when I echo again, i can successfully see the values I entered. ... > I have entered values in the HTML fields????? ... You most probably be wanting to use $_POST instead of $POST. ...
    (php.general)
  • Re: [PHP] problem with INSERT query
    ... DB Error: syntax error ... well, when I echo again, i can successfully see the values I entered. ... > I have entered values in the HTML fields????? ... You most probably be wanting to use $_POST instead of $POST. ...
    (php.general)
  • Re: [PHP] problem with INSERT query
    ... DB Error: syntax error ... well, when I echo again, i can successfully see the values I entered. ... > I have entered values in the HTML fields????? ... You most probably be wanting to use $_POST instead of $POST. ...
    (php.general)
  • Re: This is really sloppy -- help please
    ... Syntax error in query expression 'MailLog.ProcessingAssignedto Like 'Joseph' ... "John W. Vinson" wrote: ... into the single field, then extract them later. ...
    (microsoft.public.access.formscoding)
  • Re: This is really sloppy -- help please
    ... Syntax error in query expression 'MailLog.ProcessingAssignedto Like 'Joseph' ... "John W. Vinson" wrote: ... into the single field, then extract them later. ...
    (microsoft.public.access.formscoding)