BrettM
just a pert, "ex" to come
- Local time
- Tomorrow, 04:24
- Joined
- Apr 30, 2008
- Messages
- 134
Not sure if this is the correct forum but it is form based so...
I have a form with two boxes and a button (using KISS just to see what could be wrong).
RRange1 is short date format unbound text box
RRange2 is short date format unbound text box
Outdate is a field name with lots of records
The code attached to the button on click is...
This displays nothing however the report has a field on it that has as it's control source...
...and this shows the dates I expect to see so the fields are being referenced.
If I put in a breakpoint I can see that stDocRange does equal "OutDate Between 1/05/2008 And 31/05/2008".
If I change the code to ...
...it asks me for the values for RRange1 and RRange2. Then it proceeds to generate the report correctly.
What is happening here? Your assistance would be greatly appreciated.
Brett
I have a form with two boxes and a button (using KISS just to see what could be wrong).
RRange1 is short date format unbound text box
RRange2 is short date format unbound text box
Outdate is a field name with lots of records
The code attached to the button on click is...
Code:
Dim stDocName As String
Dim stDocRange As String
stDocName = "salesbystaff"
stDocRange = "OutDate Between " & RRange1 & " And " & RRange2
DoCmd.OpenReport stDocName, acPreview, , stDocRange
This displays nothing however the report has a field on it that has as it's control source...
Code:
="For period " & Forms!Main!RRange1 & " to " & Forms!Main!RRange2
If I put in a breakpoint I can see that stDocRange does equal "OutDate Between 1/05/2008 And 31/05/2008".
If I change the code to ...
Code:
Dim stDocName As String
Dim stDocRange As String
stDocName = "salesbystaff"
DoCmd.OpenReport stDocName, acPreview, , "OutDate Between RRange1 And RRange2"
What is happening here? Your assistance would be greatly appreciated.
Brett