How to Use the MsgBox Command in Microsoft Access VBA to Create an 'Are You Sure?' Prompt.

preview_player
Показать описание
In this video, I will teach you how to use the MsgBox command in Microsoft Access VBA. You will see how to create a simple popup. Then you will learn how to use MsgBox to return a YES or NO response from the user. This is helpful before running long or delicate procedures.

Anabel from Tuscaloosa, Alabama (a Gold Member) asks: I have a series of queries that I run once a month to generate reports. There's a bunch of append and delete queries in there, and they take a LONG time to run. I've accidentally clicked on the button to start this procedure a few times. Short of killing Access, is there any way to have it prompt me "Are You Sure?" before beginning this process?

BONUS FOR MEMBERS:
Silver Members and up get access to an Extended Cut of this video. Members will learn how to avoid using the MsgBox command altogether by modifying the button's caption to ask the user if they're sure.

MEMBERS VIDEO:

BECOME A MEMBER:

LEARN MORE:

LINKS:

COURSES:

FREE TEMPLATE DOWNLOADS:

ADDITIONAL RESOURCES:

KEYWORDS:
microsoft access, ms access, #msaccess, #microsoftaccess, #help, #howto, #tutorial, #instruction, #learn, #lesson, #training, #database, MsgBox, Msg Box, Message Box, MessageBox, Are You Sure, vbYesNo, vbYes, vbNo, vbYesNoCancel, Prompt User, Message Boxes, MsgBox Return Values, Yes/No, OK, Cancel

QUESTIONS:
Please feel free to post your questions or comments below. Thanks.
Рекомендации по теме
Комментарии
Автор

Exactly what I needed to learn- great tutorial

mikewaters
Автор

Pls sir how can ask by msgbox (yes or no) when i press close .
i created a exit btn

learn.chinese
Автор

Pls sir is there a way one can take ms access database to cloud (frontend and back end).

How can it be done?

Thanks so much

akokohjoel
Автор

In case I just want to confirm whether the user want to close the window form? In case he doesn't... I guess I need a command to keep the window open. Can I do it?

CrisStuart
Автор

Is there a way of triggering another button on a 'vbYesNo' 'vbYes then'? For example if I had a search function that yield no results, but there was a separate button for a different search. Would it be possible to either trigger that specific button?

saneneweyes
Автор

Hi Instructor, How do i get to the code vault for download

augustineblessing