WackyWaterGuy
Registered User.
- Local time
- Yesterday, 23:20
- Joined
- May 29, 2003
- Messages
- 25
I was beginning to think I had a lot of this figured out....and as soon as you think so......BOOOM, you hit a wall! hahhaha 
Ok, so I have been going around in circles here, hopefully someone may be able to point out where I have gone wrong. I have 2 text boxes on my form. One is for start date, and one for End date (basically, the user enters the dates they want to query between in these boxes.) I am having no issues reading these dates into two Variants in my code - StartDate and EndDate.
Below I will show my code, perhaps you can tell my why I keep getting errors.
Now, I have tried using SearchDates without the [...], but that just seems to return a blank query..so something isnt right. I have tried putting ' (single ticks) around the whole thing..but then it give an error saying that there is a "Between operator with no And". YES THERE IS!! ahhahha. Everything else I have tried seems to keep giving mismatched type errors or something.
I am just at a loss. Any help would really be appreciated!
Thank you!
WWG
Ok, so I have been going around in circles here, hopefully someone may be able to point out where I have gone wrong. I have 2 text boxes on my form. One is for start date, and one for End date (basically, the user enters the dates they want to query between in these boxes.) I am having no issues reading these dates into two Variants in my code - StartDate and EndDate.
Below I will show my code, perhaps you can tell my why I keep getting errors.
Code:
StartDate = Forms![ReportQuery]![Start Date]
EndDate = Forms![ReportQuery]![End Date]
SearchDates = "'[" & StartDate & "] And [" & EndDate & "]'"
'[COLOR=green]Then further down, I tack this on to the rest of
my query ("MySearch" contains the other information to
query..which works fine without the date!)[/COLOR]
If MySearch = MySearch Then
MySearch = MySearch & " And [Date] Between " & SearchDates
MySearchGVL = MySearch
End If
Now, I have tried using SearchDates without the [...], but that just seems to return a blank query..so something isnt right. I have tried putting ' (single ticks) around the whole thing..but then it give an error saying that there is a "Between operator with no And". YES THERE IS!! ahhahha. Everything else I have tried seems to keep giving mismatched type errors or something.
I am just at a loss. Any help would really be appreciated!
Thank you!
WWG