473,387 Members | 1,669 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Creating reports from a form. Please help.

blyxx86
256 100+
I am very new to Access, and have only been using it for a month now. I have learned how to do a lot of things, but have been having problems making a form update a query that then is sent to a report.

Here is what I would like to accomplish...

I have a table that has customers, and another table that has salesperson. I want to link certain salespersons to an individual customer. Also, each salesperson may have more than one customer. I then would like to create a form that will create a report of all the units that customer has under that salesperson.

For example, Joe has three customers. He has Cust1, Cust3, and Cust7. I want to create a combo box that has all the sales members and then will create a report that shows all the units that Cust1, Cust3, and Cust7 have bought. This way I can send the reports to each individual salesperson. I know I can setup a piece of code that will also send them an e-mail with the attached report.

I would also like to be able to filter the query by a date (or date range) on the form as well.

I normally wouldn't ask, but I have no idea how to make a form update a query and then generate the report. I also am not sure how to link the Salesperson to the customers.

I have tried making a form that updated a query, but when I went to open a report based on the query, it would fail. I don't have the error code because I have just been using manual date selection for the past week (ie, going in to the query and using BETWEEN date() AND date()-6, or actually entering the dates for the query)
Any help would be appreciated.

I am running MS Access 2000 on Windows XP Pro.
Nov 14 '06 #1
2 2014
NeoPa
32,556 Expert Mod 16PB
A report runs using a datasource (usually a query or table) but when you run the report, you have the option of passing a filter parameter.
What you need to do (as a general principle) is design the report to run on the whole dataset, then call it with your particular requirements from the form.

OpenReport Method
The OpenReport method carries out the OpenReport action in Visual Basic.

expression.OpenReport(ReportName, View, FilterName, WhereCondition, WindowMode, OpenArgs)
expression Required. An expression that returns a DoCmd object.

ReportName Required Variant. A string expression that's the valid name of a report in the current database. If you execute Visual Basic code containing the OpenReport method in a library database, Microsoft Access looks for the report with this name, first in the library database, then in the current database.

View Optional AcView. The view to apply to the specified report.

AcView can be one of these AcView constants.
acViewDesign
acViewNormal default Prints the report immediately.
acViewPivotChart Not supported.
acViewPivotTable Not supported.
acViewPreview

FilterName Optional Variant. A string expression that's the valid name of a query in the current database.

WhereCondition Optional Variant. A string expression that's a valid SQL WHERE clause without the word WHERE.

WindowMode Optional AcWindowMode. The mode in which the form opens.

AcWindowMode can be one of these AcWindowMode constants.
acDialog The form's Modal and PopUp properties are set to Yes.
acHidden The form is hidden.
acIcon The form opens minimized in the Windows taskbar.
acWindowNormal default The form is in the mode set by its properties.

OpenArgs Optional Variant. Sets the OpenArgs property.
Nov 14 '06 #2
MMcCarthy
14,534 Expert Mod 8TB
If both your forms are working fine as they are

Create a query based on the Customers and Salespersons tables joining the tables on (I presume) SalespersonID as 1 salesperson can have many customers but (I hope) a customer can have only one salesperson. If your tables don't follow this structure you have a problem. Post a list of the fields in each table and I'll help you adjust it.

Once you have your query use the report wizard to create a report on this query grouping by SalespersonID. You may have to make some adjustments but this will give you a good report template to start with.


I am very new to Access, and have only been using it for a month now. I have learned how to do a lot of things, but have been having problems making a form update a query that then is sent to a report.

Here is what I would like to accomplish...

I have a table that has customers, and another table that has salesperson. I want to link certain salespersons to an individual customer. Also, each salesperson may have more than one customer. I then would like to create a form that will create a report of all the units that customer has under that salesperson.

For example, Joe has three customers. He has Cust1, Cust3, and Cust7. I want to create a combo box that has all the sales members and then will create a report that shows all the units that Cust1, Cust3, and Cust7 have bought. This way I can send the reports to each individual salesperson. I know I can setup a piece of code that will also send them an e-mail with the attached report.

I would also like to be able to filter the query by a date (or date range) on the form as well.

I normally wouldn't ask, but I have no idea how to make a form update a query and then generate the report. I also am not sure how to link the Salesperson to the customers.

I have tried making a form that updated a query, but when I went to open a report based on the query, it would fail. I don't have the error code because I have just been using manual date selection for the past week (ie, going in to the query and using BETWEEN date() AND date()-6, or actually entering the dates for the query)
Any help would be appreciated.

I am running MS Access 2000 on Windows XP Pro.
Nov 15 '06 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Sami | last post by:
Could someone explain clearly how to go about doing this? I have tried setting up the structure on numerous occasions, but it never seems to work. Could someone please help me out? Thanks!
1
by: longtim | last post by:
I have been having endless difficulty creating reports/queries that set any relevent parameters from controls in forms. I am creating an application under access 2003 but will target access...
4
by: Tony | last post by:
G'day My attempt to create an MDE file was unsuccessful. The attempt produced an error that effectively said the (MDB) file was to big. The MDB consists of about 30 tables, 50 forms and 3...
3
by: erick-flores | last post by:
Hello all I am creating an Expense Report. There are to types of expenses: Company expenses and Reimb Expeneses. The company expenses is under "Expense Details Co" table and Reimb Expenses is...
8
by: Swans, What Swans? | last post by:
In one of my tables, in addition to a text field that is a Description field, there are two fields for color formatting the data in reports. They are Longs and hold the foreground and background...
2
by: Argonath | last post by:
Hi, I'm afraid this will no doubt horrendously basic as I'm a complete newbie to VB and have dived in without learning to do much... Start in the deep end and all. So if anyone could help, I'd...
4
by: sklett | last post by:
I've developed an ERP application that we use internally and works quite well. I receiving more and more requests from users to print various transactions, order forms, search results, etc. I...
3
by: Loogie | last post by:
I want to create reports and I don't care if I use crystal reports or vb.net reports. I am using vb.net 2005 and the app pulls data from user created access db's and compact 2005 sdf's. Here is...
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
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.