[AccessD] In a legacy system how control a Vba MsgBox

Max Wanadoo max.wanadoo at gmail.com
Thu Jan 28 14:19:07 CST 2010


Ed,

If  you are handling the code within the Form,  then this will do  it.

    Dim x As Integer
    x = MsgBox("Click Yes or  No", vbYesNo + vbQuestion, "Choose Yes or No")
    If x = vbYes Then
' code for yes
    Else
'code for no
    End If
    

Max


-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Edward Zuris
Sent: 28 January 2010 19:40
To: accessd at databaseadvisors.com
Subject: [AccessD] In a legacy system how control a Vba MsgBox

 
 Dear AccessD Forum
 
 I am doing a little automation work within a legacy
 environment.
 
 From inside some VBA code, a form is opened, given some
 data, where buttons and controls are clicked.
 
 The opened form, ft001CreateTasks, has a MsgBox asking
 a Yes/No question.
 
 What kind of handle do I use to click the YES button
 on the message box modal form ?
 
 Or are there some other way of tackling this issue ?
 
 Thanks.
 
 Sincerely,
 Ed Zuris.
 

    ====================================================
                 Example Vba Code snippet
    ====================================================
 
    strVar = ""
    DoCmd.OpenForm "ft001CreateTasks", , , strVar
 
    strVar = "Rake Yard"
 
    Forms("ft001CreateTasks").cboTaskType.Value = strVar
 
    Call Forms("ft001CreateTasks").cboTaskType_Click
 
    . . . . now a message box open on the form . . . . .
 

    ====================================================
    ====================================================
 
 
-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list