setting filter on a subform from a calendar control

P

Paul Doree

Hi,

I've got a calendar control on the main form, and I want a subform to be
filtered to the date selected on the calendar control, but can't get the
syntax right.

The subform needs to display all dates at first, until the date is selected
in the control, then once that is done just display the rows for the
selected date (the date field in the subform is called DateWorked).

Any help appreciated.

Paul.
 
D

Douglas J. Steele

Create a query to use as the RecordSource for the subform. The Where clause
should be something like:

WHERE (([MyDateField] = Forms![NameOfMainForm]![NameOfCalendarControl])
OR (Forms![NameOfMainForm]![NameOfCalendarControl] IS NULL))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top