M
MikeG
I have a form with a flexgrid. I use a query to get the data to fill the
flexgrid. I t works great as long as I enter the date range in the query like
this:
Between #99/99/9999# And #99/99/9999# (substituting the 9's with the actual
dates) in the [DateWorked] field of the query.
However, when I use another form to enter the date range: [StartDate] and
[EndDate] in the query like this:
Between Forms!frmMonthlyReport!StartDate And Forms!frmMonthlyReport!EndDate
I get this message: No value given for one or more required parameters.
I am using code to fill the flexboard. I could cut and paste it here, but it
would take up a lot of space. This is the begging of it that identifies where
the data comes from:
strSQL = "SELECT EEP1, CalDay, ConsumerName, DateWorked FROM qryEEP_Cal"
With rstHIRE
Set .ActiveConnection = CurrentProject.Connection
.CursorType = adOpenKeyset
.CursorLocation = adUseClient
.LockType = adLockOptimistic
.Open strSQL
End With
'Assign rstHIRE as the Recordset for the form
Set Me.Recordset = rstHIRE
nRecords = rstHIRE.RecordCount
Is there a way to enter the date range other than having to open the query
in design mode and entering it?
flexgrid. I t works great as long as I enter the date range in the query like
this:
Between #99/99/9999# And #99/99/9999# (substituting the 9's with the actual
dates) in the [DateWorked] field of the query.
However, when I use another form to enter the date range: [StartDate] and
[EndDate] in the query like this:
Between Forms!frmMonthlyReport!StartDate And Forms!frmMonthlyReport!EndDate
I get this message: No value given for one or more required parameters.
I am using code to fill the flexboard. I could cut and paste it here, but it
would take up a lot of space. This is the begging of it that identifies where
the data comes from:
strSQL = "SELECT EEP1, CalDay, ConsumerName, DateWorked FROM qryEEP_Cal"
With rstHIRE
Set .ActiveConnection = CurrentProject.Connection
.CursorType = adOpenKeyset
.CursorLocation = adUseClient
.LockType = adLockOptimistic
.Open strSQL
End With
'Assign rstHIRE as the Recordset for the form
Set Me.Recordset = rstHIRE
nRecords = rstHIRE.RecordCount
Is there a way to enter the date range other than having to open the query
in design mode and entering it?