LanaR
Member
- Local time
- Today, 23:45
- Joined
- May 20, 2021
- Messages
- 113
I'm currently playing with some code to deal with plurals in a combo box.
So depending on a text box that accepts a numeric value, the combo will show either singular or plural depending on the value in the text box. The code is
and is fired in the form's On Current event and the Quantity field's On Lost Focus event
This works fine when the combo drops down. However, once the combo looses focus, the data displayed reverts to the Column widths based on the data in the first record when the form initially loads. So if the first record is one or less the combo will always display the singular despite what is in the dropdown list and visa a versa if the first quantity is greater than one.
Is there another property, that I've missed, that needs to be set to overcome this?
So depending on a text box that accepts a numeric value, the combo will show either singular or plural depending on the value in the text box. The code is
Code:
If Me.Quantity.Value > 1 Then
Me.Combo0.ColumnWidths = "0 ;0 ;2.542 cm"
Else
Me.Combo0.ColumnWidths = "0 ;2.542 cm ;0 "
End If
This works fine when the combo drops down. However, once the combo looses focus, the data displayed reverts to the Column widths based on the data in the first record when the form initially loads. So if the first record is one or less the combo will always display the singular despite what is in the dropdown list and visa a versa if the first quantity is greater than one.
Is there another property, that I've missed, that needs to be set to overcome this?