postermmxvicom
Programmer
I have a form used for data entry. It is for making inventory adjustments. There is a combo box, where the user can select which inventory item to adjust.
Now, what I would like, is to have it so that whenever the combo box is blank (either because the user has deleted the information there OR because they have completed an entry and the form has moved on to a new blank record) that a certain button would be invisible.
Now, I can accomplish this, by placing code in multiple events, but my question is: Is there a single event where I could place this code only once to accomplish the same thing? Secondarily, if there is no such event: Should I be using a different pair of events, other than the two I have chosen (AfterUpdate on the combobox and Current on the form)?
Currently my code is as follows:
Private Sub FKLot_AfterUpdate()
If IsNull(Me.FKLot) Then
Me.ZeroOutLot.Visible = False
Else
Me.ZeroOutLot.Visible = True
End If
End Sub
Private Sub Form_Current()
If IsNull(Me.FKLot) Then
Me.ZeroOutLot.Visible = False
Else
Me.ZeroOutLot.Visible = True
End If
End Sub
Now, what I would like, is to have it so that whenever the combo box is blank (either because the user has deleted the information there OR because they have completed an entry and the form has moved on to a new blank record) that a certain button would be invisible.
Now, I can accomplish this, by placing code in multiple events, but my question is: Is there a single event where I could place this code only once to accomplish the same thing? Secondarily, if there is no such event: Should I be using a different pair of events, other than the two I have chosen (AfterUpdate on the combobox and Current on the form)?
Currently my code is as follows:
Private Sub FKLot_AfterUpdate()
If IsNull(Me.FKLot) Then
Me.ZeroOutLot.Visible = False
Else
Me.ZeroOutLot.Visible = True
End If
End Sub
Private Sub Form_Current()
If IsNull(Me.FKLot) Then
Me.ZeroOutLot.Visible = False
Else
Me.ZeroOutLot.Visible = True
End If
End Sub