G
Guest
Hi
I have a button on main switch board for "Print by Report #" it opens input message to type the report number they are looking for. I have a table "tblBPLReport" that has "ReportID" as auto# and "BPLReport" as a text(for the report number, Can have numbers and Alphabetical.) both are set to Primary keys.
I have my report as "rptMasterBPLReport" and its "record source" is off "qryBPLReport
The Report form "frmMainForm" its Record Source is off "tblBPLReport" and the Report "text box's" Control Source is off "BPLReport
I tried this code from the button "Print by Report #" as an OnClick Event and it just goes and open the report from the first one in line regardless to the report number user is inputting.
-------------------------------------
Option Compare Databas
Option Explici
---------------------------------------
Private Sub PrintByReport__Click(
On Error GoTo Err_PrintByReport__Clic
Dim stDocName As Strin
Dim intUserRespond As Intege
Dim intReportNumber As Intege
Dim strWhere As Strin
If Me.Dirty Then 'save any edit
Me.Dirty = Fals
Els
intReportNumber = InputBox("Please enter the report number you wish to print"
stDocName = "rptMasterBPLReport
DoCmd.OpenReport stDocName, acViewPreview, , strWher
strWhere = "[qryBPLReport] = """"& Me.[qryBPLReport]""""
End I
Exit_PrintByReport__Click
Exit Su
Err_PrintByReport__Click
MsgBox Err.Descriptio
Resume Exit_PrintByReport__Clic
End Su
I need it to open the right report and be able to print it without printing ALL of the reports. PLEASE HELP
Thank you
Nadi
I have a button on main switch board for "Print by Report #" it opens input message to type the report number they are looking for. I have a table "tblBPLReport" that has "ReportID" as auto# and "BPLReport" as a text(for the report number, Can have numbers and Alphabetical.) both are set to Primary keys.
I have my report as "rptMasterBPLReport" and its "record source" is off "qryBPLReport
The Report form "frmMainForm" its Record Source is off "tblBPLReport" and the Report "text box's" Control Source is off "BPLReport
I tried this code from the button "Print by Report #" as an OnClick Event and it just goes and open the report from the first one in line regardless to the report number user is inputting.
-------------------------------------
Option Compare Databas
Option Explici
---------------------------------------
Private Sub PrintByReport__Click(
On Error GoTo Err_PrintByReport__Clic
Dim stDocName As Strin
Dim intUserRespond As Intege
Dim intReportNumber As Intege
Dim strWhere As Strin
If Me.Dirty Then 'save any edit
Me.Dirty = Fals
Els
intReportNumber = InputBox("Please enter the report number you wish to print"
stDocName = "rptMasterBPLReport
DoCmd.OpenReport stDocName, acViewPreview, , strWher
strWhere = "[qryBPLReport] = """"& Me.[qryBPLReport]""""
End I
Exit_PrintByReport__Click
Exit Su
Err_PrintByReport__Click
MsgBox Err.Descriptio
Resume Exit_PrintByReport__Clic
End Su
I need it to open the right report and be able to print it without printing ALL of the reports. PLEASE HELP
Thank you
Nadi