Using a form for critera?

  • Thread starter Thread starter Rita
  • Start date Start date
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!
 
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
'====================================================
 
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!
 
Back
Top