Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help on creating a report from a form 4

Status
Not open for further replies.

buzcut

Programmer
Dec 16, 2000
10
Hello-

Forthe longest time this has been a problem to me - the unknowing. I need to create forms that ask the user for parameters, and then the report is generated based on those parameters. Example: on the form are several text bozes and a list box. In the list box the user selects the name of the source of business. In the two text boxes the user enters the date range for the report. The Report is then generated for preview and maybe printed.

Simple, I know. But boy is this one a toughy for me!
Thanks!

Buzcut.
 
1. Create your form with the textboxs that will your users to Add the data.

2. Create a query to pull the fields needed in the report.

3. In the query's criteria grid you need to reference the form's text boxes in the following manner inserting your form name and field name as needed:

[Forms]![YourFormName]![TheFormsFieldName]

4. Set the RecordSource of your report to this query.

5. Add a command button on your form that will open the report.

Your done.

Hope this is what you were looking for...
ljprodev@yahoo.com
Professional Development
MS Access Applications
 
I'm from Brazil and for a long time it was my problem too.I have done a question last May 10 (DCount returns #error). I didn't know why, but when I did execute the report the textbox was returning #error. It did seem that the report ran first than the query. This tip, given by Lonnie Jonhson, had answered my question and solved my problem. So, thanks for all: "buzcut" for doing such a question, Lonnie Johnson for the answer, and Tek-tips for the forum.
Dorneles
 
Lonnie
I believe I have a similar problem with some differances:
My queries are searched by date
My main report is set up with sub-reports based on the queries
My form is a search by date form where the user enters the start and end date parameters.
My problem is that the main report comes up blank, showing only titles but not the information.
The queries work and if I enter the start/end date on each subreport individually (pop up window appears for each when main report is opened from menu) I get the information I'm looking for on the main report.
I have the following code on the queries:
Between [Forms]![frmSelectDate]![txtStartDate] And [Forms]![frmSelectDate]![txtEndDate]

Any suggestions would be greatly appreciated!
Thank you.
 
Does [Forms]![frmSelectDate] stay open until the report is finished loading, or do you have code that closes it?

prodevmg@yahoo.com
ProDev, MS Access Applications B-)

May God bless you in the year 2002.
 
The form stays open. However, should a code be put in place to insure that it doesn't close?
thanks
 
One thing I would do is to create some global variables which could store the information from the and be used in the query as a function in all the reports.

Send me an email at the address in this post stating our conversation and I will send you an example of such.

That's if you haven't already figured it out. prodevmg@yahoo.com
ProDev, MS Access Applications B-)

May God bless you in the year 2002.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top