A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

confused and lost



 
 
Thread Tools Display Modes
  #1  
Old April 22nd, 2010, 05:03 PM posted to microsoft.public.access.reports
GovCoder
external usenet poster
 
Posts: 6
Default confused and lost

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?
  #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?

  #3  
Old April 22nd, 2010, 07:56 PM posted to microsoft.public.access.reports
Golfinray
external usenet poster
 
Posts: 1,597
Default confused and lost

In your query criteria, try Between [ ] and [ ]
--
Milton Purdy
ACCESS
State of Arkansas


"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?

  #4  
Old April 22nd, 2010, 09:31 PM posted to microsoft.public.access.reports
GovCoder
external usenet poster
 
Posts: 6
Default confused and lost

I did, sorry, I posted a reply that included the SQL back to John Spencer but
I may have done it wrong and posted a general comment so I'll try again.

"golfinray" wrote:

In your query criteria, try Between [ ] and [ ]
--
Milton Purdy
ACCESS
State of Arkansas


"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?

  #5  
Old April 22nd, 2010, 09:35 PM posted to microsoft.public.access.reports
GovCoder
external usenet poster
 
Posts: 6
Default confused and lost

Hi John

I may have posted a general comment and not a reply back to you as I had
intended. So, just to reply again, I mean not returning any data by "not
working". It comes back with field names and pages numbers.

Here is the SQL to the query. By the way, I only used the value property
when assigning the text boxes on the form, not in the query itself.

SELECT AdultCommunityEducation.FVF100Adults, "Adults/General Population" AS
[Community Education], Sum(AdultCommunityEducation.FVF100Numberpresentati ons)
AS [Total Number of Presentations],
Sum(AdultCommunityEducation.FVF100AdultParticipant s) AS [Total Number of
Participants]
FROM AdultCommunityEducation
WHERE (((AdultCommunityEducation.FVF100Presentationdate) Between
CDate([Forms]![frmReports]![txtFirstBegin]) And
CDate([Forms]![frmReports]![txtFirstEnd])))
GROUP BY AdultCommunityEducation.FVF100Adults, "Adults/General Population";

I have tried using the parameters screen to enter the parameters as you
suggested, before I ever posted my question. That didn't work. However, it
may be I was going about it the wrong way. In those parameters, I used the
forms!frmReports!txBoxName format, the same as in the query's Between And
operator. Maybe I shouldn't have done that?

Thanks John!

"John Spencer" wrote:

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?

.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:18 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.