runtime errror 3075

compu

Registered User.
Local time
Today, 15:00
Joined
Jul 18, 2012
Messages
22
Hi everyone i have made some progress since my last post with regards to the default max and min dates.

just have this error...


i have attached a screenshot of the error...

here is my code though
Code:
strSQL = strSQL & " " & "WHERE [Clusters].Cluster_Desc =" & Chr(34) & [Combo1] & Chr(34) & " and " & DMax("Day_Month_Year", "Source") & "," & DMin("Day_Month_Year", "Source") & ";"
 

Attachments

  • error.png
    error.png
    93.7 KB · Views: 98
Can you explain the date criteria that you are trying to set and the name of the field(s) to which it is to be applied.
 
hi

okay a user has the choice of running a report by a date selection which is a start date and end date.

now i am trying to bring in the earliest and latest date should they not want to select a date range.

here is the code that i am using to get the date range


Code:
strSQL = strSQL & " " & "WHERE [Day_Month_Year] Between #" & [StartDate] & "# AND #" & [EndDate] & "#" & ";"
 
Sorry, I'm a bit confused. What does the last line of code that you posted have to do with the first line of code that you posted.
The question I asked was in relation to the first line of code.
 
okay ignore that

now do you understand what i am trying to do.

if you have a look at my screenshot you would see that it is indeed pulling the correct information but it just gives this error
 
I have already looked at the screen-shot you posted.
No, I do not understand exactly what you are trying to do because you have not answered the the question that I asked in my first post.
If you look at your screen-shot you will see that what is returned is not a valid WHERE clause. If the two dates are to be applied as criteria against one field in the query you will need to use Between, as you have in the second line of code that you posted.
 

Users who are viewing this thread

Back
Top Bottom