VB6 Check Boxes

I have a group of check boxes. They get populated with information from a database. When a user clicks the checkbox, it is supposed to save that new value. My problem is that if those boxes already have value in the database, when it is loading that information to the screen, it thinks the user click the check box, and goes to try and save it. This does not take up much time but it is a waste of resources to do all this work. Can I have my cake and eat it too?
Who is Participating?
You'll need to set a module-level flag indicating that the form is loading.  Like:

(declarations section)
Private mLoading As Boolean

(in the code where you're populating the controls)
    mLoading = True
    ' populate the controls
    mLoading = False

(in the click event for the checkboxes)
    If mLoading Then Exit Sub

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.