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

Easy solution for the vba minded, can you help??

Status
Not open for further replies.

Brambojr

Technical User
Oct 26, 2000
73
US
I am trying to streamline some of our daily startup processes at work. To that end I have created a form on with many check boxes and a "Go" button. When they click the "Go" button a macro checks the check boxes and if it is checked the appropriate report is printed. Here is the trick, one report is printed multiple times (and the number varies from day to day). I'd like to add a text box to the form and if it IsNotNull then it prints the correct number of copies. What do I do to make this happen. I am honestly trying to learn VBA so I am not some VBA mooch, but am waiting to have funds for a book or two. So, can anyone help me?!? Brambojr
 
This isn't very elegant but it will work. (too lazy to give you the right way).

Private Function fRunReport(txtReport As Text) As Boolean

Dim iCounter As Integer

If Not IsNull(Me.NameOfNumberToPrintControl) Then
For iCounter = 1 To Me.NameOfNumberToPrintControl
DoCmd.OpenReport txtReport, acViewNormal
Next
End If

End Function

To use this, you pass the name of the report to the function. This function must be in the Form's module.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top