Results 1 to 9 of 9
  1. #1
    Join Date
    Feb 2004
    Location
    UK
    Posts
    246

    Unanswered: Why isn't Dirty working?

    Hi,
    I have a form where the On Dirty event has been coded to do the following;

    Private Sub Form_Dirty(Cancel As Integer)
    Me.mustsave = True
    Me.lastupdated.Value = Now
    Me.lastupdateby.Value = CurrentUser
    End Sub

    I added the 3rd & 4th lines of code today and the fields are not updating. In addition the first field (mustsave) which was previously working correctly is now not working. The other 2 fields are used with the same code in other forms and work perfectly, but not in this form, why?

    Regards
    John

  2. #2
    Join Date
    Jan 2004
    Location
    Jersey, UK
    Posts
    108
    Just checking basics... is the code actually firing up, I mean, if you put a break in does it go into break mode?

    If not, it could be that "[Event Code]" is missing from the event property of the object.


    Regards

  3. #3
    Join Date
    Feb 2004
    Location
    UK
    Posts
    246
    I've just noticed that all 3 fields are being updated if most fields are changed but if 2 particular combo's are selected the field isn't being updated. There are other combo's on the form and these update the fields OK?
    Both these combo's have a Mousedown event, I wonder if that's to blame

  4. #4
    Join Date
    Feb 2004
    Location
    UK
    Posts
    246
    Hi,
    It is the OnMouseDown event that is causing it as I've just removed that event form one of teh 2 combo's that weren't updating the fields Ondirty and now when you change the combo it updates the 3 change fields.

    Why is this and is there a way around it as I need the OnMousedown event of these 2 combo's

    Regards
    John

  5. #5
    Join Date
    Jan 2004
    Location
    Jersey, UK
    Posts
    108
    Not sure why it's a problem but I tend to you the OnChange event of a combo rather than MouseDown - maybe this would work for you too?


    Andy

  6. #6
    Join Date
    Feb 2004
    Location
    UK
    Posts
    246
    Hi Andy,
    I'll give that a go
    Regards
    John

  7. #7
    Join Date
    Feb 2004
    Location
    UK
    Posts
    246
    Hi,
    Tried the OnChange event and I can't use that as what happens with this field is that I use the OnClick event to bring up a calendar, then the OnMouseDown event selects a date and populates the combo box.

    Regards
    John

  8. #8
    Join Date
    Feb 2004
    Location
    UK
    Posts
    246
    OK I've found away around it, I've used the OnDirty event of the Combo box to update the fields and that seems to work

    Regards
    John

  9. #9
    Join Date
    Jan 2004
    Location
    Jersey, UK
    Posts
    108
    Glad to hear it... well done!

Posting Permissions

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