Clearing content when field changes

  • Thread starter Thread starter spcscooter via AccessMonster.com
  • Start date Start date
S

spcscooter via AccessMonster.com

I have a form that I need a few fields to clear when one field changes. Is
there a way for this to happen. Here is the example.

Current Comtech Level changes from 2 to 3. I need Passed Written Exam and
Passed Practical Exam check marks to be cleared.

Any thoughts?

Thank you much,
 
I have a form that I need a few fields to clear when one field changes. Is
there a way for this to happen. Here is the example.

Current Comtech Level changes from 2 to 3. I need Passed Written Exam and
Passed Practical Exam check marks to be cleared.

Any thoughts?

Thank you much,

You can use the AfterUpdate event of the control. Let's say you have a combo
box named cboComtechLevel, and you want to clear the checkboxes if it
increases:

Private Sub cboComtechLevel_AfterUpdate
If Me!cboComtechLevel > Me!cboComtechLevel.OldValue Then
Me!chkPassed_Written_Exam = False
Me!chkPassed_Practical_Exam = False
End If
End Sub

HOWEVER... I'd REALLY worry about your logical database structure here. Do you
in fact want to permanently and irrevokably discard the information that this
person passed the written exam at level 2!? I would suggest that instead of
having a checkbox in the personnel record (as I'm guessing you now do) that
you instead have an Exams table related one to many to the personnel table,
and add a record to it when the person passes (with date, level, etc.)
 
Also, along with what John is saying, if the user changes it by
mistake, you have NO way of knowing what it was before you made the
change. (If you don't get off the record you could abort your changes,
BUT once you move off the record, you have no way of knowing what they
were before.

In all clear type actions like that, you at least need to think about
what if the user does it by mistake. Can the prior information be
recovered?

Ron
 
Back
Top