Yes, i can get the date from a calendar form. however, the problem I am facing now is that ... how to set it to be '<=(select date)'?
Sam,
I am not sure what you are asking, but here is how it should work:
1. If you need to be able to do computations for activity between a start date and an end date, you would generally create a popup date parameter form with 2 textboxes (startDate, endDate). This date parameter form is separate from your data entry forms, on which you might have a textbox for the transaction date, although you would generally just default the date to the system date and not use a calendar.
2. The textboxes for the date parameter form, should be formatted as dates, but generally be left unbound. The textbox for the transaction date in your data entry forms should be bound to date fields in the underlying table that provides the data source for your form.
3. A calendar button is assigned to a textbox on the button click event via the following expression that is placed in the button's On Click property in its property sheet.
=CalendarFor([YourTextbox1], "Select the start date")
and for the second button on the date parameter form:
=CalendarFor([YourTextbox2], "Select the end date")
and for a button on your data entry form (if needed):
=CalendarFor([YourTextbox3], "Select a date")
4. Once the date range is captured on your date parameter form, you can use as follows:
Select datefield, field2, fieldx
From yourtable
Where datefield between Forms!YourForm!YourTextbox1 and Forms!YourForm!YourTextbox2