I have a form with a button that I would like to open a report apon clicking. Right now when it is set up to open the query it does that just fine apon click. But when I change the VBA to open report it then prints the report when clicked and does not open it at all.
The form is set with a drop box and the button will open a specific query based on an option chosen from the dropbox.
This is the code I used to open the report when it prints instead. Am I missing anything? I do not have any commands to print So I am not sure why it keeps doing this.
Is the OpenReport command set to print automatically? Any help is appreciated thank you.
The form is set with a drop box and the button will open a specific query based on an option chosen from the dropbox.
This is the code I used to open the report when it prints instead. Am I missing anything? I do not have any commands to print So I am not sure why it keeps doing this.
Code:
Private Sub EmplSearchRButton_Click()
If IsNull(InformationDrop) Then
MsgBox "Please choose Information Type"
Else
If ([InformationDrop] = "Contact") Then
DoCmd.OpenReport "EmplSearchContactR"
Else
If ([InformationDrop] = "Emergency") Then
DoCmd.OpenReport "EmplSearchEmergencyR"
Else
If ([InformationDrop] = "Company") Then
DoCmd.OpenReport "EmplSearchCompanyR"
Else
If ([InformationDrop] = "Personal") Then
DoCmd.OpenReport "EmplSearchPersonalR"
End If
End If
End If
End If
End If
End Sub
Is the OpenReport command set to print automatically? Any help is appreciated thank you.