1
votes

I have searched everywhere for this and tried different criteria but for whatever reason the form which has a control box set to open a report which is based upon a query will not pull the data within the date range. Instead keep getting enter parameter value dialogue box.

The criteria in the query is stated as Between [Forms]![Form1].[StartDt] And [Forms]![Form1].[EndDt]

The form has two date inputs StartDt and EndDt and is pointed to open the report. Without the above criteria in the query the form opens the report and produces all the dates. So at least it allows me to enter dates and is connected to the query and report but without the criteria fails to isolate data within the required range.

When I place into the query containing the criteria (as above) under the appointment date field all im getting are two parameter value dialogue boxes one after the other displaying Forms!Form1.StartDt and the second, Forms!Form1.EndDt.

Apologies for being long winded but am desperate to solve this issue am new to access.

Thanks to everyone for any input. Iain

1
Remou many thanks. Im using Access 2010. The Form I use opens the report and related query upon which the report is based via a command button wizard. I dont know where to place your code. The Form also contains two unbound text boxes StartDt and EndDt. I have no problem entering the dates via popup Calender Form. The problem seems to be the criteria Between [Forms]![Form1].[StartDt] And [Forms]![Form1].[EndDt] placed in the query which is supposed to isolate data in the report within the date range selected in the Form. All im getting is two parameter value dialogue boxes(see above) HelpIain

1 Answers

0
votes

It seems you have an error in your names. One of the easiest ways to check form names is to use the immediate window. Type ctrl+G and you will end up in the code window with the cursor in the Immediate window. With the form open and a date filled in, type or paste

?forms!form1!StartDt 

Into the immediate window and hit return. If you get an error, it means that you have a name wrong somewhere along the line, either your form is not called Form1, and form names can be a little complicated, or your control is not called StartDt. So this is where the version of Access comes in. In Access 2010, if you type Forms! on the criteria line of a query and wait a second, it will give you a list of forms. Pick your form from the list and type ! after the name, Access will come back with a list of controls. Pick your control. You should now have the right form and control name.