Re: Runtime error 2001




Well, I moved the piece that is collecting the taxtype data to the front of
the Where clause (right after the State) so that I could see as it was
running that the value was being collected properly.

It does show correct State=GA, TaxType = 16, City = College Park
Now, I can get the query to run (via an Access query) with these criterion
however I cannot seem to write the query via SQL and get it to run. My SQL
is not the absolute best it could be but I do know how to write it, yet I
can't get the syntax correct to test it. I'm at my wits end, as not only do
I have to use this form to filter, but then I need to be able to use the
generated SQL statement to create an update query and append query as well!

"JimBurke via AccessMonster.com" wrote:

I still think it's something in the SQL. Could it be something in the WHERE
clause? This could explain why it worked one time and not another. Depending
on the conditions that were true when the code was executed. you'll get a
different WHERE clause. If you know the exact conditions that were true when
you got the error, try executing that SQL (open a recordset with it or
execute it via DoCmd) and see if you get some sort of SQL-related error. If
you can execute that exact same SQL successfully then it's something else.

ThriftyFinanceGirl wrote:
Yes the join is actually correct, the name of that one field "TaxName" is a
holdover from naming by a previous worker. However they are both number
fields and the join is correct. Also, I tried to take out that quote as you
suggested, and I got syntax error until I put it back....

It looks like right before you append your WHERE clause you concatenate a
single quote onto your SELECT (that's what it looks like anyway, hard to tell
[quoted text clipped - 50 lines]

Me.qryWorkWithTax_subform.Form.Requery

--
Jim Burke

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-modules/200907/1


.



Relevant Pages

  • Re: creating and executing queries in VBA.
    ... Execute it into what? ... You can't just "execute" a select query. ... When you execute sql it has to go into a report, or a form or a record set. ...
    (microsoft.public.access.modulesdaovba)
  • Re: export form filtered data to excel
    ... ' There's no ORDER BY in the SQL. ... ' Remove the semi-colon from the end, then append the WHERE clause ... Or, better yet, look at the actual SQL for your query and see what's ... Dim qdfTemp As DAO.QueryDef ...
    (microsoft.public.access.formscoding)
  • Re: Query to Count Duplicate Values in a Given Date Range
    ... Show" to note whether the client showed up at the pantry. ... Now, if I try to run the query with that field, it returns no results. ... Here's my final SQL code if you see anything else that may need adjusting. ... use a WHERE clause rather than HAVING for the dates, ...
    (microsoft.public.access.queries)
  • Re: Error: Specified field could refer to more than one table
    ... WeeklyMileage) in SELECT Clause my guess is that the reference exists ... Run the query and select Remove Filter/sort from the menu and then save the ... Copy the SQL text into a blank query and try switching into design view ... FROM clause of your SQL statement. ...
    (microsoft.public.access.queries)
  • Re: Error: Specified field could refer to more than one table
    ... WeeklyMileage) in SELECT Clause my guess is that the reference exists ... Run the query and select Remove Filter/sort from the menu and then save the ... Copy the SQL text into a blank query and try switching into design view ... FROM clause of your SQL statement. ...
    (microsoft.public.access.queries)

Loading