Warning message before update

  • Thread starter Thread starter Dimitris Nikolakakis
  • Start date Start date
D

Dimitris Nikolakakis

In a form I have two fields: Quantity, PackagingQty

I want to check if "Quantity MOD PackagingQty <>0" and if so to appear a
warning message (probably in BeforeUpdate)

No I have the check in Validation Rule of the field Quantity but this
prevents the record from saving. I want the user to see the message and then
decide if he wants the quantiy he entered.

thanks
 
You're correct. Use the BeforeUpdate event of the control instead of the Validation Rule.

In the BeforeUpdate event try something like:

If Me.Quantity MOD Me.PackagingQty <> 0 Then
If Msgbox("Do you want to use this value?", vbYesNo + vbQuestion) = vbNo Then
Cancel = True
Me.ActiveControl.Undo
End If
End If
 

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

Back
Top