Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating a form to enter report criteria

Status
Not open for further replies.

meliorexi

Technical User
Dec 1, 2003
16
AU
Hi

I am attempting to create a form that will accept a date and return all reports with the same invoice date. I have created the form and now need to enter the criteria in the query underlying the report (as per step 9 in Help in Access XP).

As the database is an adp I have to explicity name the parameters in the stored procedure and then use those parameters in the WHERE clause. I typed - @InvoiceDate datetime WHERE InvoiceDate = Inv_Date (where InvoiceDate is the name of the date control form and Inv_Date is the field in the query it is trying to match to).

I got the response that the Query Designer does not support the @InvoiceDate SQL construct. I tried doing it in the SQL Server view but with the same result.

I am confused as to why I got this message as I followed the steps exactly.

Any help appreciated.
 
Hi,

You should use a stored procedure and use the where clause like this

WHERE Inv_Date = @InvoiceDate

Then in the report enter the input paramater as

@InvoiceDate = forms!frmMyform!MyControl

obviously with the correct form and control name
 
The parameters are entered positionally in the order they appear in the stored procedure.

Exec MyStoredProc 22, 'abc'

The parms above are defined as int and varchar in the SP.

In the Access adp the interface takes the parameters and restructures to be in the format shown above.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top