Results 1 to 9 of 9
  1. #1
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Run time error 3075 (A2k)

    Jeremy

    Was this a PC that had Access 97 and you upgraded to Access 2k or have you moved it from one PC to another?

    You maybe referencing a library that was on the other PC which is not available or has a newer version of the library.

    Have a look for Comctl32.ocx and see if it is available on your PC
    Jerry

  2. #2
    5 Star Lounger
    Join Date
    Nov 2004
    Location
    Wilmington, North Carolina, USA
    Posts
    1,196
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Run time error 3075 (A2k)

    Nope, always A2k....references are set. comctl32.ocx is present <img src=/S/grin.gif border=0 alt=grin width=15 height=15>
    ____________________________
    Jeremy
    "If you spend more on coffee than on IT security, then you will be hacked. What&#39;s more, you deserve to be hacked." -Richard Clarke

  3. #3
    5 Star Lounger
    Join Date
    Nov 2004
    Location
    Wilmington, North Carolina, USA
    Posts
    1,196
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Run time error 3075 (A2k)

    <P ID="edit" class=small>(Edited by NYIntensity on 04-Jan-06 03:48. Modified to fix visibility ilost from formatting.)</P>Receiving run time error 3075:
    Syntax error (missing operator) in query expression '()':

    <pre>Private Sub lstProducts_AfterUpdate()
    Dim varItem As Variant
    Dim strTemp As String
    Dim strSQL As String
    Dim db As DAO.Database
    Dim qry As DAO.QueryDef
    Set db = CurrentDb

    strSQL = "SELECT tblProducts.ProductID, tblProducts.ProductName, tblOrders.SaleID, tblOrders.Date, " & _
    "tblOrders.Customer, tblOrders.Quantity " & _
    "FROM tblProducts LEFT JOIN tblOrders ON tblProducts.ProductID = tblOrders.ProductID "


    For Each varItem In Me.ActiveControl.ItemsSelected
    strTemp = strTemp & "((tblProducts.ProductName) = " & Me.ActiveControl.ItemData(varItem) & " ) Or "
    Next

    strSQL = strSQL & "WHERE (" & Left(strTemp, Len(strTemp)) & ");"

    db.QueryDefs.Delete "qryReport"

    <span style="background-color: #FFFF00; color: #000000; font-weight: bold">Set qry = db.CreateQueryDef("qryReport", strSQL)</span hi>

    CurrentDb.QueryDefs("qryReport").SQL = strSQL


    End Sub</pre>

    ____________________________
    Jeremy
    "If you spend more on coffee than on IT security, then you will be hacked. What&#39;s more, you deserve to be hacked." -Richard Clarke

  4. #4
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Run time error 3075 (A2k)

    Have you had a look to see what is in strSql just before executing that instruction?

  5. #5
    5 Star Lounger
    Join Date
    Nov 2004
    Location
    Wilmington, North Carolina, USA
    Posts
    1,196
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Run time error 3075 (A2k)

    TY for pointing my attention there....I didn't have the multiselect property set....
    ____________________________
    Jeremy
    "If you spend more on coffee than on IT security, then you will be hacked. What&#39;s more, you deserve to be hacked." -Richard Clarke

  6. #6
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Run time error 3075 (A2k)

    Are there any items selected in >>For Each varItem In Me.ActiveControl.ItemsSelected<< ?

    Why don't you set a breakpoint at the start of this routine and go one instruction at a time (F8 if you didn't know) and see what happens, also use the cursor to hover over variables to see what the contents are. If hovering the cursor does not work, open tje immediate window and check the contents of variables in there by
    ?variablename
    This shows the contents of the variable you have selected.

  7. #7
    5 Star Lounger
    Join Date
    Nov 2004
    Location
    Wilmington, North Carolina, USA
    Posts
    1,196
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Run time error 3075 (A2k)

    Pat,
    Thanks for the great tips....after thinking about hovering on strSQL, I looked at strTEMP. I had incurred that problem before (strTemp = ""), but had forgotten what I did. Thank you for poking my brain, shoving it into the right direction.
    ____________________________
    Jeremy
    "If you spend more on coffee than on IT security, then you will be hacked. What&#39;s more, you deserve to be hacked." -Richard Clarke

  8. #8
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Run time error 3075 (A2k)

    That's ok, but I thought you may have a problem with a trailing OR in strTemp.

  9. #9
    5 Star Lounger
    Join Date
    Nov 2004
    Location
    Wilmington, North Carolina, USA
    Posts
    1,196
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Run time error 3075 (A2k)

    I did....good eye, but I fixed that as well. <img src=/S/thankyou.gif border=0 alt=thankyou width=40 height=15>
    ____________________________
    Jeremy
    "If you spend more on coffee than on IT security, then you will be hacked. What&#39;s more, you deserve to be hacked." -Richard Clarke

Posting Permissions

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