How do I ask user for extra info for report?

casper

Registered User.
Local time
Today, 07:01
Joined
Aug 26, 2006
Messages
12
Hi there,
I have a report that's generated from a table which has data that has been imported from an Excel file. The report runs great but I'm wondering if it possible to ask the person running the report for extra information to add to the report?

I would like the user to enter the month that the report is being run for - this info isn't saved anywhere in the table.

For example: Run the report and the user is asked for the month - they enter August 2006 and this info is added to the page header of the report. Is this possible?

Many thanks in advance

Michael
 
Hello:

Here would be one way: Run the report rptTest in the database.
Regards
Mark
 

Attachments

Hi Mark
Many thanks for that. It does what I want but it displays the input for every page of the report. Can it be modified to ask for it just once?

Michael
 
Hello:
Please look at the enclosed example report that has more than one page. It asks the question only once. You have to make sure the text box is in the report section not page section. Also you may have to dress things up a little.
Best of luck with this.
Mark
 
Many thanks but still not right - my fault, I don't think I've explained it correctly or fully
I have a report based on a table that contains, amongst other things, company names. I've grouped the report by company names placed it in the company name header and set the following property - Force New Page = Before Section. So when the report is run I get some thing like:
Page 1 = Company 1
Page 2 = Company 2
Page 3-5 = Company 3
Page 6 = Company 4
Page 7-13 = Company 5

The report is setup like so:
Page Header
Company Name Header
Detail
Page Footer

So when the report is run the user is asked for the month and this is put into the page header of every page.

Again many thanks and I hope the above makes sense :)
 
Hello:

Okay, I believe this is correct now. Take a look!
The report has a little code behind it in the code section. It asks for the date, and then stores this value in the Tag property of the report. You may have to dress things up a bit.
Good luck with this:
Mark
 

Attachments

Exactly what I need. Many many thanks. I haven't implemented it yet but I'll let you know how it goes.

Michael
 
Hi mhartman
tried to make sense of your solution and couldn't - my ignorance of Access I'm afraid. But it did give a few ideas to try and I ended up with the following:

Added a label to the Page Header and called it lbldate. Then in the code behind the report I added

Private Sub Report_Open(Cancel As Integer)
ReportMonth = InputBox("Please Enter Month")
lblDate.Caption = ReportMonth

End Sub

Works a treat :)

Many thanks for all your help.

Michael
 
Hi Michael

Your example is the best way to add user imput or extra something to a report. Another helpful hint - I find when designing reports that using unbound fields in the report you can write in SQL code that will do advance calulations for you that are to acheive with queries.

but... if you want to actually keep that data enter you need to build a form and collect that way.
 

Users who are viewing this thread

Back
Top Bottom