Results 1 to 5 of 5
  1. #1
    4 Star Lounger
    Join Date
    Feb 2008
    Location
    United Kingdom
    Posts
    490
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Code not working (MSACCESS 2003)

    I have some code in the change event of a combo. I have also tried putting it in the afterupdate event, but both events give same result.

    Me.RCHECK.Caption = Me.StarRating.Text
    ' If record not changed then disable accept1
    If Me.RCHECK.Caption = Me.StarRating.OldValue Then
    Me.SaveClip.Enabled = False
    Else
    Me.SaveClip.Enabled = True
    End If

    If I use debug, and hover over Me.StarRating.OldValue , there does not seem to be a value?

    Any ideas/reason, thanks

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Code not working (MSACCESS 2003)

    The code does enable and disable SaveClip, but it's not clear what you want to accomplish. As written, SaveClip will be disabled each time the user selects an item from the dropdown list, because at that moment, the text and old value become the same.

  3. #3
    4 Star Lounger
    Join Date
    Feb 2008
    Location
    United Kingdom
    Posts
    490
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Code not working (MSACCESS 2003)

    Many thanks Hans, that explains it. What I am trying to do is enable or disable a save button which if a user was to select a new value would enable the save button but if they went back and selected the old value would disable the save button. Regards

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Code not working (MSACCESS 2003)

    You could store the previous value in a module-level variable, but you'd have to think carefully when you would want to update its value. I don't think it would be easy to make it work corrctly in all circumstances.

  5. #5
    4 Star Lounger
    Join Date
    Feb 2008
    Location
    United Kingdom
    Posts
    490
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Code not working (MSACCESS 2003)

    Thanks Hans, simple things in life are never easy!. I think I will enable the save button on any change and have an undo button. Have a good weekend. Regards

Posting Permissions

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