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!

dialog box to choose between 4 reports to print directly from a form 2

Status
Not open for further replies.

awinter

Technical User
Nov 6, 2001
15
GB
Hi all,

I have used this code to print a report directly from a form which works brilliantly, I found it on this forum ta whoever it was (sorry I can't remember).
Dim strCriteria As String

strCriteria = "[Tooling Information]![Tooling ID]=[Forms]![Tooling Information]![Cost Sheet Number (calculated)]"
DoCmd.OpenReport "Tooling Information4", acNormal, , strCriteria

The "Tooling Information4" report is one of 4. What I would like to do is pop up a box that askes the user which report they want to print. Each report has a different number of prices for quatation purposes.

Thanks in advance
Allan
 
Hi Allan!

Try this:

Dim strCriteria As String
Dim strReportName As String

strReportName = InputBox("Please enter you report: ")
strCriteria = "[Tooling Information]![Tooling ID]=[Forms]![Tooling Information]![Cost Sheet Number (calculated)]"
DoCmd.OpenReport strReportName, acNormal, , strCriteria

This assumes that the user will know the name of the report as it appears in the database.

hth Jeff Bridgham
bridgham@purdue.edu
 
Blimy that was quick!, I guess I could change the names of the report to 1,2,3,4. That way this would work.
Thanks
Allan:D
 


OR

strReportName = "Tooling Information" & InputBox("Please enter you report: ")

 
Thanks people, for your help, it is greatly appreciated. Just goes to show it's not what you know but who you know somtimes.
 
Thanks people, for your help, it is greatly appreciated. Just goes to show it's not what you know but who you know sometimes.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top