Popup menu writing value from array

المشرف العام

Administrator
طاقم الإدارة
I have successfully created a custom dialog box which uses an array to read in a list of developer names from a table, and populates the selected record based on the row number pulled in from the developer table.

Table is Developer ID Developer Name1 A developer2 B developer3 C developer4 D Developer5 AAA Developer6 C2 developer

I have also had success in then populating the selected value from the popup menu back to the table. At present the developer list contains about 400 names. As new names are found, they need to be added to the table. In above example- ID 1 to 4 were added initially then 5 and 6 later and they aren't sorted alphabetically.

My question is does anyone know if there any way that I can I get the table from the array in alphabetical order without upsetting the row numbers from the developer table? If I add say another 50 developers to the bottom of the table then it becomes hard to find them as they are not sorted alphabetically - whilst the first 400 I put in are.

Given that the popup menu reads in the row number and assigns this to the value in the popup menu then writes it based on the value selected in the popup, I am unsure whether this can be done.

iRows1 = TableInfo(developer, TAB_INFO_NROWS)'redim developername array based on number of rows in tableReDim sDeveloperName1(iRows1)For iLoop1 = 1 to iRows1 Fetch rec iLoop1 from developer sDeveloperName1(iLoop1) = developer.developernameNext'Developer details groupboxcontrol groupboxtitle "Developer Details"Position 5,206 width 130 height 97control statictext position 10,216 title "Primary developer"control popupmenu position 10,228 width 120 ID 20Title from Variable sDeveloperName1 into iDeveloperID1outSub ReadIn_PopUpMenu_Items 'converts table value into the popupmenu item for primary developer listed dim developerID1temp as integer developerID1temp=selection.developerID1 if developerID1temp=0 then alter control 20 value 1 Else alter control 20 value developerID1temp end ifend

'if 1st value in popup menu is selected then developer is unknown so write the 'value back to the selected record as 0 if iDeveloperID1out=1 then update selection set col20=0 else update selection set col20=iDeveloperID1out End If



أكثر...
 
أعلى