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

  • Thread starter Thread starter Tom
  • Start date Start date
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
 
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.
 
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.
 
Back
Top