Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!
  1.   Become a Supporter    ::   Make a Contribution   
    Target (Recurring Monthly): $200 :: Achieved: $95

Reverting drop-down box value

Discussion in 'Information Technology' started by Someone, Nov 19, 2005.

  1. Someone

    Someone
    Expand Collapse
    Guest

    Hello

    I have entered the following code in the AfterUpdate property of a drop-down
    box called 'Status' (I found this in a reply by Allen Browne to someone
    else, so thank you!).

    Dim strMsg As String
    With Me.Status
    If .Value <> .OldValue Then
    strMsg = "You have changed the Status from " & .OldValue & _
    " to " & .Value & "." & vbCrLf & "Continue?"
    If MsgBox(strMsg, vbYesNo + vbQuestion) = vbNo Then
    .Undo
    End If
    End If
    End With

    The drop-down box is bound (as is the whole form). If the user selects no,
    how can I get the original value of the drop-down box to reappear? I'm
    worried that users who select no and don't see it revert back will think
    there's a problem.

    Thanks
    M
     
  2. Loading...

    Similar Threads Forum Date
    Controversial Sikh Groups Warn Against Reverting To Bikrami Calendar Hard Talk Feb 11, 2014

  3. John Vinson

    John Vinson
    Expand Collapse
    Guest

    On Fri, 18 Nov 2005 22:47:00 -0000, "Someone" <someone@somewhere.com>
    wrote:

    >Hello
    >
    >I have entered the following code in the AfterUpdate property of a drop-down
    >box called 'Status' (I found this in a reply by Allen Browne to someone
    >else, so thank you!).
    >
    > Dim strMsg As String
    > With Me.Status
    > If .Value <> .OldValue Then
    > strMsg = "You have changed the Status from " & .OldValue & _
    > " to " & .Value & "." & vbCrLf & "Continue?"
    > If MsgBox(strMsg, vbYesNo + vbQuestion) = vbNo Then
    > .Undo
    > End If
    > End If
    > End With
    >
    >The drop-down box is bound (as is the whole form). If the user selects no,
    >how can I get the original value of the drop-down box to reappear? I'm
    >worried that users who select no and don't see it revert back will think
    >there's a problem.


    Instead of undo, put

    Me.Status = Me.Status.OldValue

    though actually Undo should have the same effect... doesn't it?

    John W. Vinson[MVP]
     
  4. Someone

    Someone
    Expand Collapse
    Guest

    "John Vinson" <jvinson@STOP_SPAM.WysardOfInfo.com> wrote in message
    news:eqqsn1l9gvp0iii8hecfepcdovn8n7248e@4ax.com...
    > On Fri, 18 Nov 2005 22:47:00 -0000, "Someone" <someone@somewhere.com>
    > wrote:
    >
    >>Hello
    >>
    >>I have entered the following code in the AfterUpdate property of a
    >>drop-down
    >>box called 'Status' (I found this in a reply by Allen Browne to someone
    >>else, so thank you!).
    >>
    >> Dim strMsg As String
    >> With Me.Status
    >> If .Value <> .OldValue Then
    >> strMsg = "You have changed the Status from " & .OldValue & _
    >> " to " & .Value & "." & vbCrLf & "Continue?"
    >> If MsgBox(strMsg, vbYesNo + vbQuestion) = vbNo Then
    >> .Undo
    >> End If
    >> End If
    >> End With
    >>
    >>The drop-down box is bound (as is the whole form). If the user selects
    >>no,
    >>how can I get the original value of the drop-down box to reappear? I'm
    >>worried that users who select no and don't see it revert back will think
    >>there's a problem.

    >
    > Instead of undo, put
    >
    > Me.Status = Me.Status.OldValue
    >
    > though actually Undo should have the same effect... doesn't it?
    >
    > John W. Vinson[MVP]


    Marvellous - it works!

    The Undo command didn't work for me. I was surprised, hence why I posted to
    the group.

    Thank you very much for your reply.

    M
     
Since you're here... we have a small favor to ask...

More people are visiting & reading SPN than ever but far fewer are paying to sustain it. Advertising revenues across the online media have fallen fast. So you can see why we need to ask for your help. Donating to SPN's is vote for free speech, for diversity of opinions, for the right of the people to stand up to religious bigotry. Without any affiliation to any organization, this constant struggle takes a lot of hard work to sustain as we entirely depend on the contributions of our esteemed writers/readers. We do it because we believe our perspective matters – because it might well be your perspective, too... Fund our efforts and together we can keep the world informed about the real Sikh Sikhi Sikhism. If everyone who writes or reads our content, who likes it, helps us to pay for it, our future would be much more secure. Every Contribution Matters, Contribute Generously!

    Become a Supporter      ::     Make a Contribution     



Share This Page