Those are part of the application, so you can use those but I forget how. I know the other posters can help. The reason I forgot is that I use my own dialogs. I turn the Append query (and other dialogs) off with
DoCmd.SetWarnings False
Then throw my own dialog boxes and take the values when needed.
Go to the VBA window, then select View > Object Browser, then scroll down the classes to vbMsgBoxResult, and vbMsgBoxStyle.
vbMsgBoxStyle will give you the buttons you need, then to grab whether Yes, No or Cancel was clicked, you would do:
sResult = MsgBox("Your Message", vbYesNoCancel) ' I am not sure of the syntax right here, but do a search at MSDN for MsgBox.
Then check the results:
Yes = 6, No = 7, Cancel = 2
If sResult = 6 Then ...
Or
Select Case sResult
Case 6
Case 7
Case 2
etc.
Turn the warnings back on with
DoCmd.SetWarnings True
HTH
mmcdonal
|