Here is my form:
The combo boxes labeled "Front/Back Color" are the problem
I am having a problem getting my combox boxes to trigger my onChange event. The onChange event simply .Activate()s the next combo box on my form. The combo boxes are dynamically populated buy a function called in my OnArrive event
Here's the function:
The line in blue is where I set my combo box list. I'm not sure if it's proper to add a chr(13)+chr(10) as the first item in the list... could this have anything to do with the problem??
-- The first time you select a color from any of the combo boxes in EITHER "Front Colors" OR "Back Colors" you will see ALL of the colors in the dropdown list.
-- After you select the first color it should be removed from the list for the next dropdown box.
-- The idea is that the user shouldn't be able to select the same color twice for "Front Colors" OR "Back Colors".
The problem can be repeated if you:
1. open the OConfirm_Form
2. click on the 3rd tab (Piece Description)
3. click on the Add button
4. Select a color from the top combo box under the label "Front Colors"
5. Select a color from the combo box below the first selection.
-- The very first item in the combo box list is a blank.
6. Change the first (or second) combo box to the blank.
-- Most of the time the OnChange event won't fire.
-- The problem can occur on ANY of the combo boxes under "Front Colors" or "Back Colors".
-- When the onChange event doesn't fire if you try to change the color you just set to blank back to the color it was before you "blanked" it, the list will not have been refreshed. This "Refreshing" occurs in the OnArrive event of each combo box.
If anybody has any insight as to why this is happening I would be eternally grateful! Thanks in advance!
The combo boxes labeled "Front/Back Color" are the problem
I am having a problem getting my combox boxes to trigger my onChange event. The onChange event simply .Activate()s the next combo box on my form. The combo boxes are dynamically populated buy a function called in my OnArrive event
Here's the function:
Code:
[COLOR=darkorange]FUNCTION SetInkColors AS V (form as C, field as C)[/COLOR] [COLOR=darkorchid]DIM pObj as P[/COLOR] [COLOR=darkorchid]DIM fld as C[/COLOR] [COLOR=darkorchid]DIM arrayFld as C[/COLOR] [COLOR=darkorchid]DIM selectedColors[5] as C[/COLOR] [COLOR=darkorchid]DIM color[19] as C[/COLOR] [COLOR=red]' Build a string containing the field name.[/COLOR] fld = ":"+form+":"+field pObj = eval(fld+".this") [COLOR=red]' Same as fld but doesn't include the last character of the field name.[/COLOR] arrayFld = substr(fld, 1, len(fld)-1) [COLOR=red]' Initalize the color array with all of the possible color choices.[/COLOR] color.initialize(<<%list% Yellow Autumn Orange Red 185 Flag Red Rubine Burgundy Rhodamine Purple Violet Reflex Blue Turquoise Process Blue Medium Blue Sunlight Green Green 347 Green 357 Irish Green Dark Brown Gold %list%) [COLOR=red] ' Loop through the array containing all of the colors.[/COLOR] [COLOR=red] ' Compare the each color with the five color fields on the form.[/COLOR] [COLOR=red] ' IF we find a match... set that color = "".[/COLOR] FOR j = 1 TO 19 STEP +1 FOR i = 1 TO 5 STEP +1 IF (color[j] = eval(arrayFld+alltrim(str(i))+".value")) color[j] = "" END IF NEXT NEXT [COLOR=red] ' Set the combobox = CR-LF string of the colors left in the original [/COLOR] [COLOR=red] array.[/COLOR] [COLOR=red] ' The first element is a blank followed by CR-LF.[/COLOR] [COLOR=blue] pObj.settings.dynamic_list = chr(13)+chr(10)+color.dump("R")[/COLOR] [COLOR=darkorange]END FUNCTION[/COLOR]
-- The first time you select a color from any of the combo boxes in EITHER "Front Colors" OR "Back Colors" you will see ALL of the colors in the dropdown list.
-- After you select the first color it should be removed from the list for the next dropdown box.
-- The idea is that the user shouldn't be able to select the same color twice for "Front Colors" OR "Back Colors".
The problem can be repeated if you:
1. open the OConfirm_Form
2. click on the 3rd tab (Piece Description)
3. click on the Add button
4. Select a color from the top combo box under the label "Front Colors"
5. Select a color from the combo box below the first selection.
-- The very first item in the combo box list is a blank.
6. Change the first (or second) combo box to the blank.
-- Most of the time the OnChange event won't fire.
-- The problem can occur on ANY of the combo boxes under "Front Colors" or "Back Colors".
-- When the onChange event doesn't fire if you try to change the color you just set to blank back to the color it was before you "blanked" it, the list will not have been refreshed. This "Refreshing" occurs in the OnArrive event of each combo box.
If anybody has any insight as to why this is happening I would be eternally grateful! Thanks in advance!
Comment