Help please!
I want to use the "Office Assistant - Balloon object" to promt users for a selection and run the apprpriate code. The following routine works upto a point but I have a problem with the 'Cancel' button. If the user selects a check box then Clicks "Cancel" it still runs as if the user clicks OK. What changes do I need to make to interrogate the button pressed 'OK' or 'Cancel'. It does not seem to work like the MSGBOX() function. I am sure the answer is simple when you know how - but I can't find it in the help!
With Assistant.NewBalloon
.Heading = "Operation Selection"
.Text = "Select the required Operation"
.Checkboxes(1).Text = "Add a new record""
.Checkboxes(2).Text = "Edit an record"
.Button = msoButtonSetOkCancel
.Show
Select Case True
Case .Checkboxes(1).Checked
DoCmd.OpenForm "Add New Record Form", , , , A_ADD
Exit Sub
Case .Checkboxes(2).Checked
DoCmd.OpenForm "Filter_Select_Form"
Exit Sub
Case Else
'user pressed cancel - return to mainmenu
DoCmd.OpenForm "Main Menu"
Exit Sub
End Select
End With
[This message has been edited by GaryC (edited 07-02-2001).]
[This message has been edited by GaryC (edited 07-02-2001).]
I want to use the "Office Assistant - Balloon object" to promt users for a selection and run the apprpriate code. The following routine works upto a point but I have a problem with the 'Cancel' button. If the user selects a check box then Clicks "Cancel" it still runs as if the user clicks OK. What changes do I need to make to interrogate the button pressed 'OK' or 'Cancel'. It does not seem to work like the MSGBOX() function. I am sure the answer is simple when you know how - but I can't find it in the help!
With Assistant.NewBalloon
.Heading = "Operation Selection"
.Text = "Select the required Operation"
.Checkboxes(1).Text = "Add a new record""
.Checkboxes(2).Text = "Edit an record"
.Button = msoButtonSetOkCancel
.Show
Select Case True
Case .Checkboxes(1).Checked
DoCmd.OpenForm "Add New Record Form", , , , A_ADD
Exit Sub
Case .Checkboxes(2).Checked
DoCmd.OpenForm "Filter_Select_Form"
Exit Sub
Case Else
'user pressed cancel - return to mainmenu
DoCmd.OpenForm "Main Menu"
Exit Sub
End Select
End With
[This message has been edited by GaryC (edited 07-02-2001).]
[This message has been edited by GaryC (edited 07-02-2001).]