Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 28th, 2006, 05:05 AM
Authorized User
 
Join Date: Apr 2006
Posts: 53
Thanks: 0
Thanked 0 Times in 0 Posts
Default Append dialog Box

Hi all,

When you use an Append query you get a dialog box with information about appending of which you can choose yes, no or cancel.
Can somebody help how I can use these variables in VBA. For example. If I select append yes, I get a msgbox back with the return value so I can use this for further coding.

rgrds,

Paul.

 
Old April 28th, 2006, 10:56 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

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





Similar Threads
Thread Thread Starter Forum Replies Last Post
AJAX Dialog Box onlyyourspiyu Ajax 0 May 19th, 2008 08:43 AM
Custom Dialog Box hari.gomatum Javascript 3 October 4th, 2007 02:09 AM
Dynamic Dialog Box peace2007 Ajax 1 September 26th, 2007 08:26 AM
Bypass a Dialog Box SerranoG Access VBA 3 December 22nd, 2004 05:00 PM
insert dialog box in a dialog box BurhanKhan Visual C++ 7 June 1st, 2004 07:53 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.