Robert
robert at servicexp.com
Thu Jan 28 14:12:17 CST 2010
Off the top.... strVar = "Rake Yard" With Form_ft001CreateTasks .cboTaskType.Value = strVar Call .cboTaskType_Click 'Must be dimmed public I believe. .Visible = True End With It's probably better form to break out the code under the click event to its own function, and then call it as public function on its own. Public sub cboTaskType_Click () If ClickMeNow = True then 'do something End if End function Public Function ClickMeNow()as boolean ' Do something here End function strVar = "Rake Yard" With Form_ft001CreateTasks .cboTaskType.Value = strVar Call .ClickMeNow .Visible = True End With WBR Robert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Edward Zuris Sent: Thursday, January 28, 2010 2:40 PM 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