My questions has two parts:
1. How to create a menu using macro's.
2. How to dynamically suppress or disable options on that menu using VBA code in the Current Event of a From.
I want to create a menu that will come up when a user right clicks on specific line of a continuous form. For example purposes say continuous form name is 'frmOrders' and each line on the form contain information pertaining to an order for a client. The right click menu will be called 'OrderOptions' (which I would like to build with a macro will have options such as:
View Client Address Record
Send Late Notice
Mark as Paid
Re-Print Original Invoice
I will set up frmOrders' to have 'OrderOptions' specified as the ShortcutMenuBar
Depending on the specific line the user is on, certain options are not pertinent and I don't want the user to see them when the righ click menu comes up. For example if the order has been paid in full there is no reason for the user to see the options 'Send Late Notice' or 'Mark as Paid'.
I envision code in the in the current event of the form such as the following (Pseudo code):
Private Sub Form_Current()
if me.status=paidinfull
suppress option 'Send Late Notice' in Menu 'OrderOptions'
suppress option 'Mark as Paid' in Menu 'OrderOptions'
else
show option 'Send Late Notice' in Menu 'OrderOptions'
show option 'Mark as Paid' in Menu 'OrderOptions'
endif
end sub
any suggestions?