Hi folks
I hope someone can help me here.
I designing a Query By Form so that I have multiple criteria for a report.
part of the code will be for one date criteria which is in the short date format and the other date criteria that will be added will be just the month and year.
I'm trying to work out the best way to do this. The last time I used the latter criteria I used DateSerial which took the month and year which was the criteria I set in the query itself I created an filter form for this.
This time I'd like to do it in code.
The code I have for the short data format is This:
If Not IsNull(Me![txtEndDate]) Then
where = where & " AND [SendDate] between #" + _
Me![txtStartDate] + "# AND #" & Me![txtEndDate] & "#"
Else
where = where & " AND [SendDate] >= #" + Me![txtStartDate] _
+ " #"
End If
The txtStartdate and txtEndDate will be in relation to the txtcontrols I have for the Filter form.
And Id like to have the code for the date criteria that will just take the month and year?
Does anyone know how I'd do this?
I hope someone can help me here.
I designing a Query By Form so that I have multiple criteria for a report.
part of the code will be for one date criteria which is in the short date format and the other date criteria that will be added will be just the month and year.
I'm trying to work out the best way to do this. The last time I used the latter criteria I used DateSerial which took the month and year which was the criteria I set in the query itself I created an filter form for this.
This time I'd like to do it in code.
The code I have for the short data format is This:
If Not IsNull(Me![txtEndDate]) Then
where = where & " AND [SendDate] between #" + _
Me![txtStartDate] + "# AND #" & Me![txtEndDate] & "#"
Else
where = where & " AND [SendDate] >= #" + Me![txtStartDate] _
+ " #"
End If
The txtStartdate and txtEndDate will be in relation to the txtcontrols I have for the Filter form.
And Id like to have the code for the date criteria that will just take the month and year?
Does anyone know how I'd do this?