View Full Version : Paramater Input?


Codesmith
09-03-2001, 08:21 PM
I have a form with a print button on it. It is based on a query with a date range given by a custom input form. When I go to use the print button, it keeps asking me for the start and end dates in MS'Enter Paramater' form. Im new to access and I don't know what could be causing this?

DJBummy
09-04-2001, 12:05 AM
Is the date range in the criteria field in the query?

Chris RR
09-04-2001, 06:51 AM
My hunch is that the query and the form are calling those parameters by two different names. Look at the field name in your form and write it down EXACTLY. Now, look at the query. If the field in the form that you named "fMy_Form" is XXYZZ, then the criteria in the query needs to be:
[Forms]![fMy_Form]![XXYZZ]

R. Hicks
09-04-2001, 07:58 AM
Make sure that in your code you execute the query before you execute any code to close the current form. This will cause that problem.

RDH

Codesmith
09-04-2001, 08:18 AM
The subform is based on a query, and the form is unbound. The problem seems to be that the subform is in an unbound form. When I open the subform and print it on its own it works fine, but I have it in an unbound form and it won't print that way.

[This message has been edited by Codesmith (edited 09-04-2001).]

Fornatian
09-04-2001, 08:28 AM
The easiest way to exactly reference fields on a form in a query is to:

1.ensure the form with the criteria on is open

2.right click in the criteria fieldin the query where you want the criteria to go.

3. Select the build button to open the expression builder

4. Select the Forms node

5. Select Loaded Forms node from the Forms node

6. Select <Field List> from the second column

7. The third column will show you the field names available(if it's unbound then you will have to select it directly in the second column.)

8. Double click the desired field and the correct expression will appear at the top

9. Click OK - the reference goes to the query

10. Try it out.

11. Sit back and chill.

Ian

Rich
09-04-2001, 12:07 PM
Are you trying to print the form or a report?
Forms aren't optimised for printing and the general consensus is not to print the form.