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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OpenReport Conditon

Status
Not open for further replies.

Barker1

Technical User
Mar 13, 2003
3
US
I need a couple examples of how to create a condition to open and print a report. All attempts return, report is misspelled, not open, or doesnt excist.

Thanks
 
You want to open a report from a command button or such???

DoCmd.OpenReport "rptName", acPreview will open the report in preview mode

DoCmd.OpenReport "rptName" will send the report directly to the printer Only two things are infinite, the universe and human stupidity, and I'm not sure about the former. (Albert Einstein)

Robert L. Johnson III, MCSA, CNA, MCP, Network+, A+
w: robert.l.johnson.iii@citigroup.com
h: mstrmage@tampabay.rr.com
 
Well, No....


I have 7 queries, one for each day of the week
I have 7 reports, one for each day of the week

I built a table, containing, Dates, Day Of The Week
(simualur) to a forever calander

So, if date in calender = date in query/report, Day of the week = "Wednesday"

Condition:
If Day of the week is Wednesday, OpenReport Wednesday
If Day of the week is Thursday, OpenReport Thursday
ect
ect
ect
 
Okay....

Let's start with the basics....If the reports are identical, except for the data displayed, you are on the wrong path....one query, one report is all that is needed. You just change one parameter in the query (using a text box feed from you call point or something) and it wil all work itself out....

But as you setup is....you would need to do something like:

Select Case DayOfWeek
Case "Monday": DoCmd.OpenReport "Monday", acPreview
...
End Select

If you want to send me a sample of the db, I would be happy to take a lok and set you in the right direction. It is hard to determine if you are using vbWeekday or what to detemine which day of the week you are working with, what other variables may be in play, etc.

I strongly recommend using only one query/report if at all posible.....WHy make seven updates (and you know you will be updating this later) when you can make one and have all the "reports" receive the change. Only two things are infinite, the universe and human stupidity, and I'm not sure about the former. (Albert Einstein)

Robert L. Johnson III, MCSA, CNA, MCP, Network+, A+
w: robert.l.johnson.iii@citigroup.com
h: mstrmage@tampabay.rr.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top