Endojoe
Registered User.
- Local time
- Today, 10:16
- Joined
- Apr 7, 2009
- Messages
- 20
I have a form in which I need to auto-populate a couple of controls when data entry begins in certain controls. I have achieved this using the following:
However...the last ElseIf will not clear the controls. I would like the auto-populated controls to clear themselves if the user mistakenly enters data then deletes it. I have tried using the above code in the 'on change' and 'on Key Press' events also, to no avail. I'm either mis-using Null somehow, I need to use a different event trigger, or perhaps split the statement between two event triggers, I've tried numerous variations of all the above with no luck. Any suggestions?
Thanks In Advance
-Will-
Code:
Private Sub PART1_Dirty(Cancel As Integer)
If Me.Cert_Type = 1 Then
Me.ITEM1 = "1"
Me.SER1 = "N/A"
ElseIf Me.Cert_Type = 2 Then
Me.ITEM1 = "1"
Me.SER1 = SPU_LOT_NUMBER
ElseIf Me.PART1 = Null Then
Me.ITEM1 = Null
Me.SER1 = Null
End If
End Sub
However...the last ElseIf will not clear the controls. I would like the auto-populated controls to clear themselves if the user mistakenly enters data then deletes it. I have tried using the above code in the 'on change' and 'on Key Press' events also, to no avail. I'm either mis-using Null somehow, I need to use a different event trigger, or perhaps split the statement between two event triggers, I've tried numerous variations of all the above with no luck. Any suggestions?
Thanks In Advance
-Will-