Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2003
    Location
    San Francisco
    Posts
    5

    Question Unanswered: "Before Update" follow up procedure

    Hello,

    I am trying to protect a value in field by warning user that changing it might (not neccessarily) have negative effect on previous calculations.

    I have a message box asking do you want to go ahead with the change or not. and being an amateur that I am, I have no idea what ot have in the if clauses:

    Warning = MsgBox(Msg, Style, Title)
    if Warning = vbYes (go ahead and change the value)
    if Warning = vbNo (no, keep the old value)

    Please note that just locking the field is not an option. The value must be available for update, and I need a warning.

    Thanks a lot.

    Max

  2. #2
    Join Date
    Aug 2003
    Location
    Toronto, Canada
    Posts
    10
    Before Update event procedures in Access have a Cancel property built-in (Private Sub cboMyCombo_BeforeUpdate(Cancel As Integer)) so you can 'cancel' the update if the user answers 'no' or 'cancel'.

    Try this:

    intResponse = MsgBox strMessage, etc..

    if intResponse = vbNo then Cancel = True

    That should be all you have to do unless there is something I misunderstood.


    Peter

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •