473,473 Members | 2,002 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Custom Reports by Form input (user picks report options on Form and gets report showing options picked)

RC
I can't quite grasp the concept of creating custom reports depending
upon what options a user picks on a Form. For example, the user
clicks on a "Print Reports" button and a Form pops up. On the Form
the user can choose to get a report that shows the Box Numbers that
are at Warehouse A, Warehouse B or Warehouse C. and then click on the
Print Preview button and get a report showing only the Box Numbers in
whichever warehouse was selected.
My project is 99% done but I just can't get this last report bit. I am
using Access 2002 but the database (for some reason) says that it is
in Access 2000 format. I've tried altering code from the Northwind
database but I got hopelessly lost in the code and got one error after
another. Thanks in advance for your help.
Nov 12 '05 #1
3 2884
RC wrote:
I can't quite grasp the concept of creating custom reports depending
upon what options a user picks on a Form. For example, the user
clicks on a "Print Reports" button and a Form pops up. On the Form
the user can choose to get a report that shows the Box Numbers that
are at Warehouse A, Warehouse B or Warehouse C. and then click on the
Print Preview button and get a report showing only the Box Numbers in
whichever warehouse was selected.
There is a number of ways to achieve this. We build a WHERE clause and
then some code behind the report adds it to the report's RecordSource
(We have a wizard that allows the user to build filters using english
rather than the field names)

eg. Code behind form build a WHERE clause and assigns it to a global
variable then opens the selected report

Report OnOpen event

If Len(GV_REPORT_CRITERIA) > 0 then
Me.RecordSource = "SELECT * FROM (" & Me.RecordSource & ") WHERE " &
GV_REPORT_CRITERIA & ";"
End If
My project is 99% done but I just can't get this last report bit. I am
using Access 2002 but the database (for some reason) says that it is
in Access 2000 format.
AccessXP (2002 and 2003) use the Access2000 file format by default. Not
a lot is gained by using AccessXP formatted database files and it makes
it easier for clients using different versions of Office.
I've tried altering code from the Northwind
database but I got hopelessly lost in the code and got one error after
another. Thanks in advance for your help.


A simple method is to reference some fields on the form in the query
behind the report.

eg. SQL query behind report (the form remains open behind the report or
hidden)

SELECT * FROM [qryMyReportQuery] WHERE [MyField] =
[Forms]![frmReportFilter]![MyFilterValue];

Hope that gives you some ideas...
--
regards,

Bradley
Nov 12 '05 #2
RC
Where/how do you put the variable (intWarehouseB) that you get from
the Form into the Report?

rc*********@yahoo.com (RC) wrote in message news:<3c**************************@posting.google. com>...
I can't quite grasp the concept of creating custom reports depending
upon what options a user picks on a Form. For example, the user
clicks on a "Print Reports" button and a Form pops up. On the Form
the user can choose to get a report that shows the Box Numbers that
are at Warehouse A, Warehouse B or Warehouse C. and then click on the
Print Preview button and get a report showing only the Box Numbers in
whichever warehouse was selected.
My project is 99% done but I just can't get this last report bit. I am
using Access 2002 but the database (for some reason) says that it is
in Access 2000 format. I've tried altering code from the Northwind
database but I got hopelessly lost in the code and got one error after
another. Thanks in advance for your help.

Nov 12 '05 #3
RC
Thank You ! I think I now grasp the concept. Instead of passing a
variable to the report, I fill the report with data based on a query
and the query is controlled by the user input on the form. OR, on
loading the report restrict the record source to specific data with a
Where clause.
Thanks again, I will try these methods and see if I can get it to
work.

"Bradley" <br*****@REMOVETHIScomcen.com.au> wrote in message news:<40******@nexus.comcen.com.au>...
RC wrote:
I can't quite grasp the concept of creating custom reports depending
upon what options a user picks on a Form. For example, the user
clicks on a "Print Reports" button and a Form pops up. On the Form
the user can choose to get a report that shows the Box Numbers that
are at Warehouse A, Warehouse B or Warehouse C. and then click on the
Print Preview button and get a report showing only the Box Numbers in
whichever warehouse was selected.


There is a number of ways to achieve this. We build a WHERE clause and
then some code behind the report adds it to the report's RecordSource
(We have a wizard that allows the user to build filters using english
rather than the field names)

eg. Code behind form build a WHERE clause and assigns it to a global
variable then opens the selected report

Report OnOpen event

If Len(GV_REPORT_CRITERIA) > 0 then
Me.RecordSource = "SELECT * FROM (" & Me.RecordSource & ") WHERE " &
GV_REPORT_CRITERIA & ";"
End If
My project is 99% done but I just can't get this last report bit. I am
using Access 2002 but the database (for some reason) says that it is
in Access 2000 format.


AccessXP (2002 and 2003) use the Access2000 file format by default. Not
a lot is gained by using AccessXP formatted database files and it makes
it easier for clients using different versions of Office.
I've tried altering code from the Northwind
database but I got hopelessly lost in the code and got one error after
another. Thanks in advance for your help.


A simple method is to reference some fields on the form in the query
behind the report.

eg. SQL query behind report (the form remains open behind the report or
hidden)

SELECT * FROM [qryMyReportQuery] WHERE [MyField] =
[Forms]![frmReportFilter]![MyFilterValue];

Hope that gives you some ideas...

Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: BStorm | last post by:
I have a transaction log file where the DataSet table's Description column is actually delimited into "subcolumns" based upon the transaction id. I would like to parse these into separate fields...
7
by: DD | last post by:
Hi I want the user to be able to view all reports from a form either by way of a list box or dropdown or ?? any help please DD
7
by: dog | last post by:
I've seen plenty of articles on this topic but none of them have been able to solve my problem. I am working with an Access 97 database on an NT4.0 machine, which has many Access reports. I...
11
by: Grasshopper | last post by:
Hi, I am automating Access reports to PDF using PDF Writer 6.0. I've created a DTS package to run the reports and schedule a job to run this DTS package. If I PC Anywhere into the server on...
2
by: Darryl Kerkeslager | last post by:
As the subject above hopefully makes clear, I want to do several reports, "with lots of fields not otherwise in database". These reports also have variable-length text. I have defined the...
0
by: Henry | last post by:
Using ideas provided by some of you I was able to figure out how to get the names of the parameters fields of a crystal report specified at run time. The code below just basically puts the...
3
by: joelpollock | last post by:
I'm having trouble continuously page numbering a large report in MS Access. The report is made up of three separate Access reports which I join together at the end. In the past I have opened the...
10
by: glenfernandez | last post by:
HI there, Need a little help with the reporting component of my MS Access 2002 project and would appreciate any insight / help from the experts. Please bear with me as I am still learning Access...
22
by: g diddy | last post by:
Hi I'm relatively new to VBA and could really do with some help please!! This is going to sound really long winded i'm sorry but I hope it will paint a picture of what i'm trying to do. Basically...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.