Results 1 to 2 of 2
  1. #1
    LindaRuble is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Aug 2012
    Posts
    63

    Need to stop update on drop-down. Need to keep OldValue

    Hello,



    I would like to stop the user from changing informaiton on a record by mistake. I do not want the user to change the value of the drop-down after a value has been already input.
    I have successfully written VBA to pop up a message only when someone changes the drop-down value and not when the value is Null.

    What I need help with is to keep the old value of the drop-down, or at least not update a new value. Here is the code I have tried but can't prevent a new value from being saved on top of the old value.


    I've tried....


    Code:
    Private Sub Combo75_Dirty(Cancel As Integer)
        If Not IsNull(Me!Client_Division) Then
            Me.Client_Division.Value = Me.Client_Division.OldValue        
            MsgBox "A CLIENT/DIV has already been selected. Please do not change."
        End If
    End Sub
    I've tried....


    Code:
    Private Sub Combo75_Dirty(Cancel As Integer)
        If Not IsNull(Me!Client_Division) Then
            Me.Client_Division.Locked = True
            MsgBox "A CLIENT/DIV has already been selected. Please do not change."
        End If
    End Sub
    I've tried....


    Code:
    Private Sub Combo75_Dirty(Cancel As Integer)
        If Not IsNull(Me!Client_Division) Then
            Me.Client_Division.Undo = True        
           MsgBox "A CLIENT/DIV has already been selected. Please do not change."
        End If
    End Sub

    I have not been successful in stopping the update. Any help would be appreciated.

    Thanks

    Linda

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,948
    Try using the combobox BeforeUpdate event.

    What if user accidentally made wrong selection the first time? Won't allow correction?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 12-30-2011, 01:20 PM
  2. Replies: 3
    Last Post: 11-29-2011, 07:01 AM
  3. automatische stop
    By Foli in forum Access
    Replies: 0
    Last Post: 12-20-2010, 02:24 AM
  4. Replies: 2
    Last Post: 11-29-2009, 12:00 PM
  5. How to stop....
    By swampdonkey in forum Forms
    Replies: 0
    Last Post: 12-04-2006, 01:56 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums