Setting query parameters from a query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need step by step instructions on how to get parameters for a query from a
form that is completed by a customer.

Your help will save me fropm insanity

Peter
 
I need step by step instructions on how to get parameters for a query from a
form that is completed by a customer.

The simplest way (and you don't describe your existing attempts, the
code you're using, or much else) is to simply include them as explicit
parameters in the Query's definition:

Parameters [Forms]![MyForm]![txtStartDate] DateTime,
[Forms]![MyForm]![cboCustomerID] Long Integer;
SELECT whatever
FROM whereever
WHERE [DateField] = [Forms]![MyForm]![txtStartDate] AND [CustomerID] =
[Forms]![MyForm]![cboCustomerID];

John W. Vinson[MVP]
 
In the Criteria line of the Query's grid, put the line

Forms!NameOfOpenForm!ControlName.Value

Notice the "!" between different objects, and dots "." to denote properties.
Don't confuse them!

HTH
 
Back
Top