I have 6 identical comboboxes on a form. All the comboboxes are identical, except for differences in names. The top 2 comboboxes seem to work corretly all of the time. The bottom 4 comboboxes don't. Combbox 1 and 2 are at the top of the form. Combobox 3,4,5, and 6 are lower on the form and are placed one above the other in a columnar fashion. Combobox 3 also seems to work correctly all of the time.
The problem is in the bottom 4 comboboxes:
When I create a new record by pressing my new button, and choose a value from each of the 4 bottom comboboxes and do a save, only the 1st combobox saves and the rest clear.
Then, if I press my edit button, and edit the remaining 3 comboboxes, and choose a value from each of the 3 remaining comboboxes and do a save, only the 2nd combobox saves and the rest clear and so on.
If I repeat the edit process for the remaining 2 comboxes then I eventually get all the comboboxes to save correctly and not clear.
I have never seen this one before and I been working on a solution for hours and still don't know what's wrong.
Here is my code for the comboboxes (the only difference being the field name is unit_type1, unit_type2, unit_type3, unit_type4 for the 4lower 4 comboboxes):
GotFocus -
INSMODE(.F.)
LostFocus -
INSMODE (.T.)
Refresh -
THIS.DisplayValue = ALLTRIM(arrest.unit_type1)
Valid -
REPLACE arrest.unit_type1 WITH ALLTRIM(THIS.DisplayValue)
Here are the properties for the comboxes (with different names for different unit_types as above):
BoundColumn = 1
BoundTo = .F.
ColumnCount = =ALEN(aunits,2)
ColumnLines = .F.
ColumnWidths = 200
ControlSource = None
DisplayValue = cbo_unit_type1
First Element = 1
Format = !K
Name = cbo_unit_type1
Number of Elements = =ALEN(aunits)
RowSource = aunits
RowSourceType = 5-Array
Style = 0-Dropdown Combo
The droplist list does show my first column of my array of unit_types.
My "Save" and "Cancel" buttons have the standard TABLEUPDATE and TABLEREVERT commands in the buttons. And I am not clearing the Combobox DisplayValue, except when I create a new record. It doesn't matter if I am in Add or Edit mode, I have the problem. It's just more obvious in Add mode because 3 comboboxes clear and the top one does not. Thanks for your inputs. I have really PUZZLED by this.
Steve Kramer
Kramer & Kramer Design
"Home of Go Cartoons"
Web Site:
www.stephenkramer.comWould you believe Far Side Lite?
More than 270 original cartoons.