Use of Control Key on a button

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

On the On_Click event, I have the following code:

Private Sub Report3Button_Click()

Dim stDocName As String
If acCtrlMask = 2 Then
stDocName = "WarehouseYTDReport"
Else
stDocName = "WarehouseErrorReport"
End If

DoCmd.OpenReport stDocName, acPreview

End If
End Sub

When I run this code, I only get one response,
stDocName = "WarehouseYTDReport"

Can someone tell me what I am doing wrong?
 
OOPS! I see my mistake.... I moved it to the mouse_down and it works
perfectly.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top