Results 1 to 5 of 5
  1. #1
    Join Date
    Nov 2001
    Posts
    45

    Red face Unanswered: Error 3601 - am I BLIND??? Simple SQL Query works in Forms but not as Recordset

    Well Error 3601 seems to appear when one sets a recordset Object with table fields that do not exist (keyword 'missspellig')...

    But what's wrong with this one???

    Set rsInvoices = CurrentDb.OpenRecordset("SELECT * FROM [sqlInvoicesForInvoices];", dbOpenDynaset)

    ...while the query sqlInvoicesForInvoices works fine when I open in the database window (no form fields references or anything....) or when I use it in any FORM or and REPORT. Just in pure VBA it causes Error 3601...

    AM I BLIND???????

    This is the Query:

    SELECT * FROM tblClients INNER JOIN ((tblInvoicesClientsData INNER JOIN tblInvoices ON tblInvoicesClientsData.strClientID = tblInvoices.strClientID) INNER JOIN tblUserInvoicesSelection ON tblInvoices.strInvoiceID = tblUserInvoicesSelection.strInvoiceID) ON tblClients.strClientID = tblInvoicesClientsData.strClientID WHERE (((tblUserInvoicesSelection.strUserID)=[application].[currentuser]));

    Anybody any idea?

  2. #2
    Join Date
    May 2002
    Posts
    395
    Set rsInvoices = CurrentDb.OpenRecordset("SELECT * FROM [sqlInvoicesForInvoices];", dbOpenDynaset)

    Try removing the ; after [sqlInvoicesForInvoices] in your sql statement.

    Good Luck!

  3. #3
    Join Date
    Jul 2002
    Location
    Romania
    Posts
    122
    As I can see, you want to return ALL records from your query.
    Why don't you use
    Set rsInvoices = CurrentDb.OpenRecordset("sqlInvoicesForInvoices")

    You don't need dbOpenDynaset because it's the default mode-if possible.

    HTH,
    Dan

  4. #4
    Join Date
    May 2002
    Posts
    395
    As I can see, you want to return ALL records from your query.
    Why don't you use
    Set rsInvoices = CurrentDb.OpenRecordset("sqlInvoicesForInvoices")

    You don't need dbOpenDynaset because it's the default mode-if possible.

    HTH,
    Dan

    Report this post to a moderator | IP: Logged

  5. #5
    Join Date
    Nov 2001
    Posts
    45
    Actually later on I really need a SUBSET of that data... trying to track down the 3601 error i just narrowed the query statement and removed all WHERE clauses.... Unfortunately the direct query reference as you suggested does't work either... still the same error... Thanks though!

Posting Permissions

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