Results 1 to 4 of 4
  1. #1
    stahir01 is offline Novice
    Windows 10 Access 2010 32bit
    Join Date
    Nov 2021
    Posts
    2

    Run-Time error '3075'

    Hello Everyone,


    I am new to VBA in access. I tried to run this but the code shows me the following error:


    SQL_Run = "SELECT VT, x_HSBEZ, x_NSBEZ, SippGroup, LT_ST, Sum(ST) AS [Sum of Onrents], ServiceLine, Case, Company" & _
    "FROM Onrent" & _
    "GROUP BY VT, x_HSBEZ, x_NSBEZ, SippGroup, LT_ST, ServiceLine, Case, Company;"

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,566
    And 3075 is ?
    Debug.Print sql_run and see if you can spot the error?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  3. #3
    kd2017 is offline Well, I tried at least.
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Posts
    1,165
    You forgot some spaces. This
    Code:
    SQL_Run = "SELECT VT, x_HSBEZ, x_NSBEZ, SippGroup, LT_ST, Sum(ST) AS [Sum of Onrents], ServiceLine, Case, Company" & _
    "FROM Onrent" & _
    "GROUP BY VT, x_HSBEZ, x_NSBEZ, SippGroup, LT_ST, ServiceLine, Case, Company;"
    evaluates to:
    Code:
    SELECT VT, x_HSBEZ, x_NSBEZ, SippGroup, LT_ST, Sum(ST) AS [Sum of Onrents], ServiceLine, Case, CompanyFROM OnrentGROUP BY VT, x_HSBEZ, x_NSBEZ, SippGroup, LT_ST, ServiceLine, Case, Company;
    Try this:
    Code:
    SQL_Run = "SELECT VT, x_HSBEZ, x_NSBEZ, SippGroup, LT_ST, Sum(ST) AS [Sum of Onrents], ServiceLine, Case, Company" & _
    " FROM Onrent" & _
    " GROUP BY VT, x_HSBEZ, x_NSBEZ, SippGroup, LT_ST, ServiceLine, Case, Company;"
    <edit>
    Yes! As Welsh mentions always Debug.print your strings during development when you build them this way so you can double check that they are put together the way you wanted them to be.

  4. #4
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,938
    another hint - look for missing spaces

    edit - never mind, KD has done it for you

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

Similar Threads

  1. Replies: 6
    Last Post: 02-03-2020, 07:09 PM
  2. Replies: 13
    Last Post: 05-31-2019, 10:48 PM
  3. Replies: 2
    Last Post: 01-04-2016, 09:40 AM
  4. Replies: 11
    Last Post: 05-01-2014, 11:56 AM
  5. Replies: 6
    Last Post: 05-30-2012, 12:32 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