G
Guest
I'm using the following code to enable listbox lstVendor depending on input from listbox lstType. LstVendor is not enabled when I first see the form, is enabled when I choose the 2nd in lstType. But when I tab out of lstType to lstVendor the IOCNumber in the Open event goes to zero (It increments correctly except under the conditions I've described). Can anyone tell me what is happening? Thx, Robbie
Private Sub Form_Open(Cancel As Integer)
DoCmd.GoToRecord , , acNewRec
Me.IOCNumber = Nz(DMax("[IOCNumber]", "[tblIOCLog]", ""), 0) + 1
Me.lstVendor.Enabled = False
End Sub
'Enable certain fields depending on choice of type from lstType
Private Sub lstType_Exit(Cancel As Integer)
Dim i As Integer
If Me.lstType = 2 Then
Me.lstVendor.Enabled = True
End If
End Sub
Private Sub Form_Open(Cancel As Integer)
DoCmd.GoToRecord , , acNewRec
Me.IOCNumber = Nz(DMax("[IOCNumber]", "[tblIOCLog]", ""), 0) + 1
Me.lstVendor.Enabled = False
End Sub
'Enable certain fields depending on choice of type from lstType
Private Sub lstType_Exit(Cancel As Integer)
Dim i As Integer
If Me.lstType = 2 Then
Me.lstVendor.Enabled = True
End If
End Sub