Results 1 to 5 of 5
  1. #1
    4 Star Lounger
    Join Date
    Oct 2002
    Location
    Sayre, Pennsylvania, USA
    Posts
    504
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Run Time Error 3075 (2000)

    Hi,
    I have the following code below. When I try and run it I get the following error message and can't figure out what I'm doing wrong.

    "Syntax Error (missing operator) in query expression [lngMachineID]=14FMAB AND [lngRecSourceID]=4"

    Any thoughts?
    Thanks,
    Deb


    Private Sub cmdPRCreateNewRich_Click()

    Dim stDocName As String
    Dim stLinkCriteria As String

    stDocName = "frmPRNewRich"

    stLinkCriteria = "[lngMachineID]=" & Me![cboReceiveQuoteRichDPL] & _
    " AND [lngRecSourceID]=" & Me![sfrmReceiveQuoteRecSourceRich]!lngRecSourceID
    DoCmd.OpenForm stDocName, , , stLinkCriteria

    End Sub

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Run Time Error 3075 (2000)

    Me![cboReceiveQuoteRichDPL] seems to be a text field. You have to surround it by quotes :

    <pre>stLinkCriteria = "[lngMachineID]='" & Me![cboReceiveQuoteRichDPL] & _
    "' AND [lngRecSourceID]=" & Me![sfrmReceiveQuoteRecSourceRich]!lngRecSourceID</pre>

    Francois

  3. #3
    4 Star Lounger
    Join Date
    Oct 2002
    Location
    Sayre, Pennsylvania, USA
    Posts
    504
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Run Time Error 3075 (2000)

    Thanks Francois,
    That worked. What if I take out the bottom line, how would I adapt the code. I'm getting the same error message with the below code.

    stLinkCriteria = "[lngMachineID]=" & Me![cboReceiveQuoteRichDPL]
    DoCmd.OpenForm stDocName, , , stLinkCriteria

    Thanks,
    Deb

  4. #4
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Run Time Error 3075 (2000)

    Then you should use :
    <pre>stLinkCriteria = "[lngMachineID]='" & Me![cboReceiveQuoteRichDPL] & "'"</pre>

    Francois

  5. #5
    4 Star Lounger
    Join Date
    Oct 2002
    Location
    Sayre, Pennsylvania, USA
    Posts
    504
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Run Time Error 3075 (2000)

    Thank you, that worked.
    Deb

Posting Permissions

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