Dbl-clicking prints a report

valgore

Registered User.
Local time
Today, 10:33
Joined
May 24, 2012
Messages
24
Hello, i have a table that pulls all report names into it and i have a listbox in frm_Reports showing all the reports in it. when i double click the report name in the listbox, it prints instead of opening and i have no idea why. here is my code:


Private Sub List0_DblClick(Cancel As Integer)
Dim strWhere As String
If Me.List0.ItemsSelected.Count = 0 Then
MsgBox "Must select a report"
Exit Sub
End If


strWhere = Me.List0.Column(1)

DoCmd.OpenReport strWhere, acViewNormal
End Sub

any help is appreciated
 
Did you look at the arguments for OpenReport in VBA help? acViewNormal prints the report.
 
wow.... i feel stupid haha. thanks
 

Users who are viewing this thread

Back
Top Bottom