Update Query Should Bring up Warning Dialog Box w/ Text Entry

T

Tom

When executing e.g. an "Update Query", I would like to be prompted with a
"warning message" that requires actual text input.

For instance, when dropping a table via the update query, I'd like to have a
message box pop up which asks: "Are you sure to drop the table XYZ?"

Unless I type "yes" in some box, the update query will not be executed.

Is that possible? If yes, does anyone know the VBA code for that?

Thanks in advance,
Tom
 
F

fredg

When executing e.g. an "Update Query", I would like to be prompted with a
"warning message" that requires actual text input.

For instance, when dropping a table via the update query, I'd like to have a
message box pop up which asks: "Are you sure to drop the table XYZ?"

Unless I type "yes" in some box, the update query will not be executed.

Is that possible? If yes, does anyone know the VBA code for that?

Thanks in advance,
Tom

By default, you will get a warning that you are about to change x
number of records Yes/No? Click Yes or No to proceed or not.

No need to actually type anything. Just click with the mouse.

If you need some other information in the message, then run the query
from a code event:

If MsgBox("You are going to delete records from 'Table XYZ' ",
vbOKCancel) = vbOK Then
DoCmd.SetWarnings False
DoCmd.OpenQuery "qryDeleteARecord"
DoCmd.SetWarnings True
End If

You'll need to change the message depending upon the type of query you
are going to run.
 
T

Tom

Fred,

thanks for sharing the info w/ me.

Tom


fredg said:
By default, you will get a warning that you are about to change x
number of records Yes/No? Click Yes or No to proceed or not.

No need to actually type anything. Just click with the mouse.

If you need some other information in the message, then run the query
from a code event:

If MsgBox("You are going to delete records from 'Table XYZ' ",
vbOKCancel) = vbOK Then
DoCmd.SetWarnings False
DoCmd.OpenQuery "qryDeleteARecord"
DoCmd.SetWarnings True
End If

You'll need to change the message depending upon the type of query you
are going to run.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top