Ramzess II
Registered User.
- Local time
- Today, 02:55
- Joined
- Apr 7, 2004
- Messages
- 32
Hello!
I put this code:
in my form to print out a pre-defined number of copies (Copies) of the current record in the form (Filtrs). Form is based on a query which is made up from two tables where one of them contains "schID" field which as well is included in this query.
BUT when I press the button on the form it does not print out the defined number of copies of current record but actually asks me to "Enter Parameter Value" for "schID" field and when I enter this ID number it goes printing ALL records available!
What could be the reason? Could anyone help me please?
I attached this db file as well. It is in Access 2000 format.
the form where the button is is called "frmPossibleInput" and report which is used for printing is called "rptPosters"
I put this code:
Code:
Private Sub Command40_Click()
Dim Filtrs As String
Dim Copies As Integer
Dim RepName As String
Filtrs = "(((tblSchools.schID)=" & CLng(Me![schID]) & "))"
Copies = Me.psbPostersCnt
RepName = "rptPosters"
DoCmd.OpenReport RepName, acViewPreview, Filtrs, "(((tblSchools.schID)=" & CLng(Me![schID]) & "))"
DoCmd.PrintOut acPrintAll, , , , Copies
DoCmd.Close acReport, "rptPosters"
End Sub
in my form to print out a pre-defined number of copies (Copies) of the current record in the form (Filtrs). Form is based on a query which is made up from two tables where one of them contains "schID" field which as well is included in this query.
BUT when I press the button on the form it does not print out the defined number of copies of current record but actually asks me to "Enter Parameter Value" for "schID" field and when I enter this ID number it goes printing ALL records available!
What could be the reason? Could anyone help me please?
I attached this db file as well. It is in Access 2000 format.
the form where the button is is called "frmPossibleInput" and report which is used for printing is called "rptPosters"