Results 1 to 4 of 4

Thread: [RESOLVED] Cancel Combobox Change

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Apr 2007
    Posts
    26

    Resolved [RESOLVED] Cancel Combobox Change

    Basically have a combobox and on the Change event im bringing up a MsgBox asking whether I am sure I wish to change the value, which is fine. Just need some code to return the combo back to its previous value

    cheers

    Code:
    If MsgBox("Status Change: Go ahead with changes?", vbYesNo + vbQuestion, "Status Change") = vbNo Then
        
    //Here...... ''
    
    End If

  2. #2
    Addicted Member
    Join Date
    Jan 2002
    Location
    Glasgow, Scotland
    Posts
    202

    Re: Cancel Combobox Change

    Quote Originally Posted by terbs
    Basically have a combobox and on the Change event im bringing up a MsgBox asking whether I am sure I wish to change the value, which is fine. Just need some code to return the combo back to its previous value

    cheers

    Code:
    If MsgBox("Status Change: Go ahead with changes?", vbYesNo + vbQuestion, "Status Change") = vbNo Then
        
    //Here...... ''
    
    End If
    you will need to write the previous value before the change

    either using before update or on click.

    you will then have the value after update, and your msg box decision will be able to write either value back to teh combo box.
    if you fail to plan, you plan to fail

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Apr 2007
    Posts
    26

    Re: Cancel Combobox Change

    yeah I had a play with this idea myself im just unsure how to execute it.

    I declare a the variable "tempstatus" on the onClick event,

    vb Code:
    1. Dim tempstatus
    2.  
    3. tempstatus = me.cmbStatus.value

    but when I call it on the onChange event it says variable not defined

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Apr 2007
    Posts
    26

    Re: Cancel Combobox Change

    figured it out, just applied the value of the combo box to a hidden field on the GotFocus event..

    cheers

Posting Permissions

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



Click Here to Expand Forum to Full Width