C
CJ
Hi Groupies
I am using A2007
I have a multivalue combobox that lists our vehicles available for jobs. If
we use an external trucking company, I want to be sure that none of our
vehicles are selected. In previous versions I would have had no problem
using code (below) to display the field when required and clear and hide it
when not required:
Private Sub ysnCompanyVehicle_BeforeUpdate(Cancel As Integer)
If Me.ysnCompanyVehicle = True Then
Me.lngUnitID.Visible = True
Else
Me.lngUnitID = Null
Me.lngUnitID.Visible = False
End If
End Sub
The code works fine to open the combo so that I can select vehicles. The
problem is if I change my mind and decide that I do not want to use our
vehicles. With this multivalued combo, the line Me.lngUnitID=Null, causes my
check box to freeze. Basically, the system can not just remove or uncheck
all of the vehicles I might have selected. I would have to manually deselect
the vehicles from the combo and then I can deselect the check box for
CompanyVehicle
Has anybody figured out how to work around this?
I am using A2007
I have a multivalue combobox that lists our vehicles available for jobs. If
we use an external trucking company, I want to be sure that none of our
vehicles are selected. In previous versions I would have had no problem
using code (below) to display the field when required and clear and hide it
when not required:
Private Sub ysnCompanyVehicle_BeforeUpdate(Cancel As Integer)
If Me.ysnCompanyVehicle = True Then
Me.lngUnitID.Visible = True
Else
Me.lngUnitID = Null
Me.lngUnitID.Visible = False
End If
End Sub
The code works fine to open the combo so that I can select vehicles. The
problem is if I change my mind and decide that I do not want to use our
vehicles. With this multivalued combo, the line Me.lngUnitID=Null, causes my
check box to freeze. Basically, the system can not just remove or uncheck
all of the vehicles I might have selected. I would have to manually deselect
the vehicles from the combo and then I can deselect the check box for
CompanyVehicle
Has anybody figured out how to work around this?