Quantcast
Channel: dBforums – Everything on Databases, Design, Developers and Administrators
Viewing all articles
Browse latest Browse all 13329

Print fiiltered form records

$
0
0
I have an Access 2007 form that uses a parameter query, that when the user opens the form from the main menu, it asks that you enter the portfolio managers name (should be their own name), so they can only view and edit their own forms. I have added a button with ON CLICK event procedure so they can print the current form being viewed. The event opens a report using the following code (found on the net):

Private Sub cmdPrint_Click()
Dim strWhere As String

If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If

If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print"
Else
strWhere = "[LoanNumber] = """ & Me.[LoanNumber] & """"
DoCmd.OpenReport "r_CI_LoanRecords", , , strWhere
End If
End Sub

So far, it works the way I want it to.

Now I want to add another button to print the same report but print ALL the records that were returned when opening the form (from the original parameter query stated above).

I have tried a multitude of various options that I have found on the internet and not having any luck.

I also found a similar post on this forum from Sept 25, 2002, but couldn't quite follow the code that was provided as the solution (very little experience writing code).

Any help is much appreciated.

Viewing all articles
Browse latest Browse all 13329

Trending Articles