Results 1 to 3 of 3
  1. #1
    ertweety is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jun 2012
    Posts
    10

    Unhappy Run Time Error '3075'

    Hi There,



    I'm having a problem with a module I wrote and I am hoping someone can help.

    What I am Trying to Achieve - A separate report for each vendor, exported by vendor# to the C drive.

    I have a report based on a table called 'MT_SC_S15_FINAL_TABLE'. It is being grouped by the VENDOR#.

    I have another table with is called 'EDISPATCH_TOWERS'. This table has a list of all my Vendor #'s. Actually both tables include the Vendor #.

    Now this is the code I have written....
    Option Compare Database
    Function exp()
    Dim rsDat As Recordset
    Set rsDat = CurrentDb.OpenRecordset("Select [VENDOR#] From [EDISPATCH_TOWERS]")
    rsDat.MoveFirst
    Do
    DoCmd.OpenReport "rpt_scorecards", acViewPreview, , "VENDOR# = " & rsDat(0)
    DoCmd.OutputTo acOutputReport, "rpt_scorecards", acFormatPDF, "C:\ACCOUNT_" & rsDat(0) & ".pdf"
    DoCmd.Close acReport, "rpt_scorecards", acSaveNo
    rsDat.MoveNext
    Loop Until rsDat.EOF
    MsgBox "Tower Scorecards Exported"
    End Function

    The error I receive is;
    Run Time Error '3075'
    Syntax error in date in query expression 'VENDOR# = A0055'.


    A0055 is one of the vendors listed in my table.

    Help!

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,623
    You have a special character in the field name. That might be an issue. Enclose with []. Also need apostrophe delimiters for the text value. Date values use # delimiter and numbers nothing.

    "[VENDOR#] = '" & rsDat(0) & "'"
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    ertweety is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jun 2012
    Posts
    10
    Works perfect! Thanks June7!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 6
    Last Post: 05-30-2012, 12:32 PM
  2. Replies: 5
    Last Post: 03-27-2012, 01:40 PM
  3. Getting Error 3075
    By boywonder in forum Programming
    Replies: 4
    Last Post: 05-23-2011, 05:06 PM
  4. Run Time Error 3075 in Access 2007
    By jblank65 in forum Programming
    Replies: 6
    Last Post: 01-25-2011, 04:47 PM
  5. Runtime 3075 error
    By whm1 in forum Programming
    Replies: 4
    Last Post: 03-24-2010, 02:50 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums