Dear All,
I have this menu below created when the preview report button is pressed on the form, when they select print it prints the menu and not the report, how do I get it to activate the report before doing the send keys command.
Function ShowPopup()
Dim coord As POINTAPI
Dim attr&
GetCursorPos coord
DoCmd.OpenForm "Pop-up Menu Form"
attr& = GetWindowLong(Forms![Pop-up Menu Form].hwnd, GWL_STYLE)
attr& = SetWindowLong(Forms![Pop-up Menu Form].hwnd, GWL_STYLE, _
attr& And Not WS_DLGFRAME)
DoCmd.MoveSize (coord.x * 14), (coord.y * 14), , 1100
End Function
Function ItemSelected(WhichItem As String)
DoCmd.Close
Dim stDocName As String
Dim rptCurrentReport As Report
Set rptCurrentReport = Screen.ActiveReport
stDocName = rptCurrentReport.Name
If Trim(WhichItem) = "Close Report" Then
DoCmd.Close acReport, stDocName, acSaveNo
Else
SendKeys "^p", False
DoCmd.OpenForm "Pop-up Menu Form"
End If
End Function
Thanks Rob.![[yoda] [yoda] [yoda]](/data/assets/smilies/yoda.gif)
I have this menu below created when the preview report button is pressed on the form, when they select print it prints the menu and not the report, how do I get it to activate the report before doing the send keys command.
Function ShowPopup()
Dim coord As POINTAPI
Dim attr&
GetCursorPos coord
DoCmd.OpenForm "Pop-up Menu Form"
attr& = GetWindowLong(Forms![Pop-up Menu Form].hwnd, GWL_STYLE)
attr& = SetWindowLong(Forms![Pop-up Menu Form].hwnd, GWL_STYLE, _
attr& And Not WS_DLGFRAME)
DoCmd.MoveSize (coord.x * 14), (coord.y * 14), , 1100
End Function
Function ItemSelected(WhichItem As String)
DoCmd.Close
Dim stDocName As String
Dim rptCurrentReport As Report
Set rptCurrentReport = Screen.ActiveReport
stDocName = rptCurrentReport.Name
If Trim(WhichItem) = "Close Report" Then
DoCmd.Close acReport, stDocName, acSaveNo
Else
SendKeys "^p", False
DoCmd.OpenForm "Pop-up Menu Form"
End If
End Function
Thanks Rob.
![[yoda] [yoda] [yoda]](/data/assets/smilies/yoda.gif)