Gerry,
Check out the thread "Does anyone understand toolbars" in the Access
Database Forms newsgroup. I've started creating my toolbars (popup) in code
rather than using the View - Toolbars - Customize menu option. I find this
to be more flexible, and portable than the other methods. Once you have a
toolbar, menu, or shortcut menu created with code, you can display it any
time you want, and if it is a popup, you can actually position it where you
want using the "ShowPopup" method of the CommandBars object. Sample code
follows:
Const BarPopup = 5
Const ControlButton = 1
Const ControlEdit = 2
Const ControlComboBox = 4
Const ButtonUp = 0
Const ButtonDown = -1
Public Sub ReportMenu()
Dim cbr As Object
Dim cbrButton As Object
Dim strSQL As String
Dim rs As DAO.Recordset
On Error Resume Next
CommandBars("MyReportMenu").Delete
On Error GoTo ReportMenuError
Set cbr = CommandBars.Add("MyReportMenu", BarPopup, , True)
With cbr
Set cbrButton = cbr.Controls.Add(ControlButton, , , , True)
With cbrButton
.Caption = "&Print"
.Tag = "Print"
.OnAction = "=fnPrintReport()"
End With
Set cbrButton = cbr.Controls.Add(ControlButton, , , , True)
With cbrButton
.Caption = "&Close"
.Tag = "Close"
.OnAction = "=fnCloseReport()"
End With
End With
Exit Sub
ReportMenuError:
MsgBox "ReportMenu error" & vbCrLf
End Sub