Using a form for critera?

R

Rita

I would like to use a date from another table (just stores a single date) to
run my form. I also created a form with the date.

Here's my query:
Payroll Ending Date ClientID
Name
Criteria Form!PayrollEndingDate

THANKS!
 
J

John Spencer

To use a control on a form,
1) the form must be open
2) you must reference the control using
Forms![Name of Your Form]![Name of your control]

Since you are storing the information in a table you can probably just
use the DLookup function to get the value. If the table has just one
record, you could use

Criteria: DLookup("[Field Name]","[Your Table Name]")

IF the table has multiple records in two field table
fValue: Store the value you want to use
fNameOfItem: stores the type of thing stored (like Payroll End Date)


Criteria:
CDate(DLookup("fValue","tableParamValues","fNameOfItem='Payroll End Date'"))

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
'====================================================
 
R

Rita

Thanks so much! The DLookup solution worked perfect!!!!!

John Spencer said:
To use a control on a form,
1) the form must be open
2) you must reference the control using
Forms![Name of Your Form]![Name of your control]

Since you are storing the information in a table you can probably just
use the DLookup function to get the value. If the table has just one
record, you could use

Criteria: DLookup("[Field Name]","[Your Table Name]")

IF the table has multiple records in two field table
fValue: Store the value you want to use
fNameOfItem: stores the type of thing stored (like Payroll End Date)


Criteria:
CDate(DLookup("fValue","tableParamValues","fNameOfItem='Payroll End Date'"))

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
'====================================================

I would like to use a date from another table (just stores a single date) to
run my form. I also created a form with the date.

Here's my query:
Payroll Ending Date ClientID
Name
Criteria Form!PayrollEndingDate

THANKS!
 

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

Similar Threads

Muliple Critera 1
Add a field to Query 2
Critera in Crosstab Query 2
Date Query using Forms Parameter 1
Using A form to input criteria 4
Critera entries 5
forms and queries 4
criteria 1

Top