Karen
Instead of using a parameter in the report's underlying query open it from a
dialogue form with a text box txtProjectNumber and a button with code along
the following lines in its Click event procedure:
Const conREPORTNAME = "YourReportName"
Const conMESSAGE = "Do you wish to print the report?"
Dim strCriteria As String
strCriteria = "[Project Number] = " & Me.txtProjectNumber
' hide form
Me.Visible = False
' open report in print preview
DoCmd.OpenReport conREPORTNAME, _
View:=acViewPreview, _
WhereCondition:=strCriteria
' if user confirms, print report
If MsgBox(conMESSAGE, vbQuestion + vbYesNo, "Print Report") = vbYes Then
' close print preview
DoCmd.Close acReport, conREPORTNAME
' print report
DoCmd.OpenReport conREPORTNAME, _
View:=acViewNormal, _
WhereCondition:=strCriteria
End If
' show form
Me.Visible = True
' clear text box ready for next search
Me.txtProjectNumber = ""
' move focus to report in preview if open
On Error Resume Next
DoCmd.SelectObject acReport, conREPORTNAME
Instead of opening the report directly open the form. The user then enters
the project number in the text box and clicks the button. I've assumed the
project number is a number data type; if its text data type change one line
to:
strCriteria = "[Project Number ] = """ & Me. txtProjectNumber & """"
Ken Sheridan
Stafford, England
Karen said:
I currently have a report that initially prompts for a Project Number when
open.
After the report is generated, I'd then like for a second prompt asking the
user if he'd like to print the current report for search for another project.
If he opts to search for another project, I'd like to see the prompt again
for the Project Number.
Am I able to do this in Access? If so, please advise.