I have created a form to input parameters into a query to perform.
I have successfully made combo boxes for all the fields that I want, however I have run into a problem in regards to bringing up the records in between the dates that I set in the form. The result brings up all records in the table.
Form Name = [ParameterQueryForm]
Beginning Date Text Box = [DateFromBox]
End Date Text Box = [DateToBox]
Between [Forms]![ParameterQueryForm]![DateFromBox] And [Forms]![ParameterQueryForm]![DateToBox]
As far as I can tell, I have set the Date to medium date format (dd-mmm-yy)and the input mask reads 00\->L<LL\-00;0;_
Is anyone able to help on this? Oh and I also want the form to bring up all records if no date is set on the form.
Thanks again all for your help, you have been wonderful so far.
It is quite a large query, but if you want me to copy it here and show you the query in design view, I will do it tonight (about 10 hours from now).
I would increase the year to be a 4 digit year as that is much safer. Also, what is the earliest date and latest date in your table? What are the dates you are using in the query selection on the form. Also, I would suggest you let the query know that these two parameters from the form are dates. With the query open in design view, select menu Query, then option Parameters. On the left side, put in the form!frmname!ctrname EXACTLY like it is in the Between xx and xx statement. I would use the clipboard to be sure they are exact. Then show each parameter to be of type Date.
I would default the two dates in the form to dates that would include all the dates in the table.