Results 1 to 4 of 4

Thread: trigger or flag when something has changed?

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2002
    Posts
    3

    Question trigger or flag when something has changed?

    Hi,

    is there a trigger or a flag that can be raised when anything on a form as changed.

    I know I could set a boolean at false on the form_load, and on all individual textchanged and selecteditemchanged, set the boolean at true and when the user closes the form, a pop-up ask "are you sure you don't wanna save before closing?"

    any other idea more easy if there are???

    seb

  2. #2
    old fart Frans C's Avatar
    Join Date
    Oct 1999
    Location
    the Netherlands
    Posts
    2,926
    You could try to give them all the same event handler. That way you would need only one sub routine for it.

  3. #3

    Thread Starter
    New Member
    Join Date
    Jul 2002
    Posts
    3

    what king of Code I don't want

    Hi,

    of course some of them will be grouped into 1 sub.

    but the problem is that some of those textbox have already their 'textchanged' used... and what I want to prevent is to do is something like this:

    sub form_load
    dim Test as boolean = false
    blablabla
    end sub form_load

    sub textboxes_textchanged .... handles 'all the textboxes'
    if test=false then
    test=true
    end if
    end sub

    sub form_closed
    if test=true then
    dim Answer = msgbox("Do you wanna save before quitting?")
    if answer = vbyes then
    save()
    end if
    end sub

    I really would like another solution for my problem please....

    Sebastien Anselmo
    Etiquettes RTM Labels inc.

  4. #4
    hellswraith
    Guest
    You can load up the different 'changeable' field values into variables on the form load event. Then at the form closing event, check the values against what is on the form. If they are not the same, then you ask if they want to save them. If they are the same, that means that the user didn't change anything.

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