Solved: MS Access report load from a form having report criteria

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

mhegazy

Thread Starter
Joined
Aug 20, 2012
Messages
41
Dears,I have designed a database with many reports of certain importance. basically a report in my DB is one of two types; a Daily Report (requires a single criteria which is the date) and the second is a History report. To view or print a report, I have designed a Filter form to fill in with the report criteria and clicking a button to open the report.The first type (Daily R) work fine without problems. The second type (History R)has a problem. In this report, the criteria are two or three because a history report will retrieve data within a period, so I have to input (FromDate) and (ToDate)and may be adding another criteria which is called a company.In all history reports, the report header will accomodate the two input values of date and extract the rest of report items into the reprot detail area.The problem is, the desigened system doesnot respond well as expected. When I load the filter form to fill in criteria for a history report, I have input the FromDate and ToDate and selected the third criteria (if any), then, the reprot opens without data in it.on the other hand, I tried to load the report directly form opening it, inputing criteria, and it has worked fine without probelms.Would someone expect a key reason for this problem or dirtecly can solve this problem?Appreciate youtr support.Thanks in Advance.mhegazy
 

OBP

Joined
Mar 8, 2005
Messages
19,895
Do you mean that the report works when opened directly but not from the Form?
Where do you input the Criteria in the query or in the form?
 

mhegazy

Thread Starter
Joined
Aug 20, 2012
Messages
41
Yes the reports work fine when opened directly, but not opening in case of using the form.

For criteria input, im case of direct opening; in the small window query of thr
 

mhegazy

Thread Starter
Joined
Aug 20, 2012
Messages
41
Yes the reports work fine when opened directly, but not opening in case of using the form.

For criteria input, im case of direct opening; in the small window of the query and in case of the form in the form itself, it has unbound controls for this objective.
Taking into account that; in the later case the query was modified to recieve its criteria from the form; e.g. Forms!hrs_filter!reportdate.

Thx
 

OBP

Joined
Mar 8, 2005
Messages
19,895
The Form and Field names should be in square brackets.
You should get the query working first.
 

OBP

Joined
Mar 8, 2005
Messages
19,895
Sorry, but I think it is the issue, the query supplies the report, if the report is not working and it is only displaying the query results what is the query showing?
 

mhegazy

Thread Starter
Joined
Aug 20, 2012
Messages
41
Dear all,

I have attached copy of the last version of my projects.

You can go to the HRs_Filter form or the DRs_Filter form.

Input the date as for example 12/10/12 or 13/10/12 (means 12-Oct-2012) it will work for the daily reports but not work for the history reports.

You can check this yourself.

Regards,
mhegazy
 

Attachments

OBP

Joined
Mar 8, 2005
Messages
19,895
The period queries are not working.
For some obscure reason the ToDate Field on the Form is not being recognised by the Queries. I have added a new field called Text19 and it is now working.
Also you had the wrong name in the SisterCo query, it is SisterCocombo, not Combo0
See the queries in the attached database.
ps During the testing I dismantled the KCPF_Viscosity_Query_DuringPeriod Query, you will need to use your copy.
It is also not a good idea to use date field named date as that is an Access reserved word for the current date.
 

Attachments

mhegazy

Thread Starter
Joined
Aug 20, 2012
Messages
41
Thanks OBP for your support,

I have read your comments and found two queries only out of four working, so I will review all of them again later.

The question now is, why the Form & To fields in all the period reports are not working.

They supposed to have the correct equation with brackets and ! sign like the following:
[Forms]![HRs_Filter]![FromDate] and
[Forms]![HRs_Filter]![Text19]

Would you please help on this?

Regards,
mhegazy
 

OBP

Joined
Mar 8, 2005
Messages
19,895
They are working on the 2 Queries that I modified, the FromDate was working but the ToDate was not.
If you set the Criteria to just equal either date and enter a date in the field it should work for the query to filter the data, but the ToDate returns no records at all.
 

mhegazy

Thread Starter
Joined
Aug 20, 2012
Messages
41
I think misunderstand my speech.

The two queries you mentioned requiring dates are working andI tried a third one myself and really the probelm is in the date recognition.

What I am asking about is the the From & To fields in the period report itself, they should be filled from the inputs of the FromDate & the new Text19 once the report lunched.

Also, you advised that Date is an access-reserved word and should not be used, I have used FromDate and ToDate (one word) as well as ReportDate in the daily reports filter form.

Do you have another suggession instead.

Regards,
mhegazy
 

OBP

Joined
Mar 8, 2005
Messages
19,895
The note about the "Date" was to do with the names of the fields in your tables.
To use the Dates in your Report create 2 unbound fields and use the
=[Forms]![HRs_Filter]![FromDate]
and
=[Forms]![HRs_Filter]![Text19]
as their Control Sources.
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Top