Button not calling correct instruction

steve1111

Registered User.
Local time
Today, 03:44
Joined
Jul 9, 2013
Messages
170
Hello,

I am somewhat new to VBA, but i have a form that pulls in a subform specific to the CurrentUser(). It is meant to be a shortcut or favorites form that holds 8 command buttons. I have Dlookups on the form to pull the correct fields from a table for OpenForm or OpenReport and then the name of the form or report they want to open. My froms work but when i try and open a report, it just prints the (correct) report and does not open it. I just want to open it.

Private Sub cmdBtn1_Click()

If Me.btn1Action = "OpenForm" Then
DoCmd.OpenForm Me.btn1Details, acNormal, , , acFormAdd, acWindowNormal
Else
If Me.btn1Action = "OpenReport" Then
DoCmd.OpenReport Me.btn1Details, acViewNormal, , , acWindowNormal
Else
End If
End If


End Sub

thanks for any help.
 
I found my error, i opened in acViewNormal rather than acViewReport, switching did the trick
 

Users who are viewing this thread

Back
Top Bottom