Results 1 to 2 of 2
  1. #1
    3 Star Lounger
    Join Date
    Jul 2001
    Thanked 0 Times in 0 Posts

    Syntax error (Access 2000)

    How to avoid the Error "Syntax error"

    I have a list of clients in the form, with a subform called sbfRigs which open
    when the focus is on the clientid.It is ok, but i have a blank control for the new records
    and if the user get s the focus on this control, then i get the mesage that i have a syntax error,
    missing is evident why it happens, but how can i avoid the message?

    Private Sub customerid_GotFocus()
    Dim stDocName As String
    Dim strwhere
    strwhere = "[Customerid]=" & Me!customerid
    stDocName = "sbfRigs"

    End Sub

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Thanked 31 Times in 31 Posts

    Re: Syntax error (Access 2000)

    You could test if CustomerID is not null (blank):

    If Not IsNull(Me!CustomerID) Then
    strWhere = "CustomerD=" & Me!CustomerID
    End If

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts