J
John Ingato
I have a combobox on a customer form called LocationChooser which list the
properties this customer own.
When the form opens, the CB is empty (no default value) forcing the user to
choose a location
I would like to have it so if there is only one location in the list, it
would be automatically selected. I have tried the following code, which is
in the Form_Load of the customer form:
--------------------------------------------------------
Me.LocationChooser.RowSource = "SELECT JobLocations.LocationID,
JobLocations.LocationNickName" & _
" FROM JobLocations WHERE (((JobLocations.CustomerID)= " &
m_CustomerID & "));"
If Me.LocationChooser.ListCount = 1 Then
Me.LocationChooser.Selected(0) = True
End If
properties this customer own.
When the form opens, the CB is empty (no default value) forcing the user to
choose a location
I would like to have it so if there is only one location in the list, it
would be automatically selected. I have tried the following code, which is
in the Form_Load of the customer form:
--------------------------------------------------------
Me.LocationChooser.RowSource = "SELECT JobLocations.LocationID,
JobLocations.LocationNickName" & _
" FROM JobLocations WHERE (((JobLocations.CustomerID)= " &
m_CustomerID & "));"
If Me.LocationChooser.ListCount = 1 Then
Me.LocationChooser.Selected(0) = True
End If