View Single Post
  #2  
Old April 22nd, 2010, 06:33 PM posted to microsoft.public.access.reports
John Spencer
external usenet poster
 
Posts: 7,815
Default confused and lost

Well, it would help if you expanded on what you mean by "mot working".

No records returned?
Wrong records returned?
Syntax error message or other error message? What is the error message?

I suggest you post the SQL (View: SQL) of the query that is not working so it
can be examined.

As a guess, declaring your parameters in the query might solve the problem.

Open the query in design mode
Select Query: Parameters from the Menu
Fill in the EXACT name of the parameter in column 1
Select the data type of the parameter in column 2
Repeat for the other parameters.

Also, don't use the value property. Just use
forms!frmReports!txtFirstBegin

If you choose to edit the query in SQL view, you would add the parameter
section to the beginning of the query. It would look something like the
following. If your parameters are something besides dates you will have to
use the proper data types in place of DateTime.

Parameters forms!frmReports!txtFirstBegin DateTime,
forms!frmReports!txtFirstEnd DateTime;
SELECT ....
FROM ....


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

GovCoder wrote:
Okay, I've read and tried dozens of articles and suggestions about how to use
parameters, how it's done, and every time I try something, is comes up as not
working. It's a report driven by a parameter driven query. The way the
parameters are produced is to assign VBA date values to text boxes on a form,
from which the query reads the parameters using something like...

forms!frmReports!txtFirstBegin.value

I've been trying to use the Between And operator since I have two dates. It
seems to never work. I even tried entering parameters into the parameter
screen on the query, didn't work. I've tried a where variable on a
DoCmd.OpenReport statement. Didn't work. Does this even work anymore with
Access or has Microsoft made it impossible to do this now?