Melissa wrote:
How do I write the following expression so if I click through the two parameter
dialogs I get all records?
Between [Enter Start Date] And [Enter End Date]
Thanks!
Melissa
Knowing me, I'd probably create a form and scrap your parameter method.
I'd have a form with 2 date fields (from and to), a Select command
button and a Cancel command button. In the double click of each date
field I would call/present a calendar to ease data entry use. The dates
are nicely formated, may have an input mask on the form. If Cancel is
pressed, action stops. If Select is pressed write some code. Ex:
Dim strWhere As String
If Not IsNUll(Me.From) Then
strWhere = "DateField >=#" & Me.From & "# And "
Endif
If Not IsNUll(Me.To) Then
strWhere = "DateField <=#" & Me.To & "# And "
Endif
'remove AND at end of filter string
If strWhere > "" Then
strWhere = Left(strWHere,Len(strWhere)-5)
Endif
Then I'd call a form (datasheet perhaps) with your query with the
strWHere as the filter. Plus your form could add other filter parts and
you simply concatenate them to your string.
This is more powerful since you can select all records between a date,
all records if the filter is blank, all records greater/equal than the
from date, or all records less/equal the to date.
But that's my preference. Others have provided other options.