Advertisement

07.04.2008 at 06:04AM PDT, ID: 23539383
[x]
Attachment Details

Using a message box to trigger a macro (if yes)

Asked by Dozingquinn in Access Coding/Macros, Access Architecture/Design, Access Forms

Tags: Microsoft, Access, 2003

Hello,

I have a form, which has a button [cmdNewpatient]. If a user clicks this button I would like a message box to appear asking "Do you want to add a new patient" - with the options Yes/No. If the user selects 'Yes', then run the macro [mac_newpatient]. If the user selects 'no', then do nothing.

Currently I have the following code. Could you please show me how this should be reworded?Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
Private Sub cmdNewpatient_Click()
Dim Msg As String
Msg = "Do you want to add a new patient?"   
Style = vbYesNo
 
response = MsgBox(Msg, Style)
Select Case Response
  Case vbYes 
Run Mac_newpatient
  Case vbNo
   '/do nothing
End Select
[+][-]07.04.2008 at 06:11AM PDT, ID: 21932915

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Access Coding/Macros, Access Architecture/Design, Access Forms
Tags: Microsoft, Access, 2003
Sign Up Now!
Solution Provided By: peter57r
Participating Experts: 3
Solution Grade: A
 
 
[+][-]07.04.2008 at 06:35AM PDT, ID: 21933029

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.04.2008 at 06:41AM PDT, ID: 21933052

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628