Sorry, fairy56, I didn't realise before that this was a form to launch a report; that must be why the two date boxes are unbound, right?
In my experience, the Enter Parameter dialog box--when it's asking you for information that should already be available somewhere--generally means Something Has Gone Wrong, so you probably do want to get rid of it. I don't know if I will be able to help all that much, being fairly new myself, but I can suggest a few next steps to try that might narrow down what is happening.
First, from what I've been reading, for active form controls it is best to use exclamation points for the entire control's name, as in [Forms]![Dateform]![cmbsearchdate] . But I doubt that is the issue here, as Access tends to compensate.
In the query criteria, you could try >= and <= rather than > and < , in order to include the start and end dates themselves.
If you enter the data into your form and then open the query object (before clicking the command button), you can check on whether it actually returns any records. You can also check whether there
should be any records in it; set a break point (F9) when you have the following line selected in the code window:
- DoCmd.OpenReport stDocName, acPreview
Then open the form, enter data, and press the button, and when you reach the break point, open the Immediate pane (Ctrl-G) and check that Access is picking up the expected values, like so:
- ?[Forms]![Dateform]![Datefrom].[txtStart]
or
- ?[Forms]![Dateform]![txtStart]
... and so on (note the question marks). If it does not show any values, that would mean the query would not find any matches. If there are values there, something's wrong with the query criteria.
Let us know if none of this works and then hopefully someone with some experience can step in. ;-) Good luck!