![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi - I have been asked to change a combo box display to sort in alphabetical order. This is in an app I did not write, but it should be simple enough! The combo box is based on a table (and I've put in SQL and a query - same problem) It is 2 columns, bound column 1, width 0,2". Query: SELECT Departments.DeptCode, Departments.DeptName FROM Departments ORDER BY Departments.DeptName; When I run the SQL or the Query, stand-alone or from the properties window, the sorting is correct (in Dept Name order). The combo box still displays in DeptCode (Number) order. I tried changing the number of rows to display (from 8 to 20) and the column widths (to .5", 2") and nothing changes in the display! Still shows 8 rows, in number order. It's like it's not taking my changes or it's getting its direction for the combo box from somewhere else. Any ideas? Would a decompile be any help at all? There's lots of code in the app, but little in the form and nothing with this combo box. Thanks - Sara |
#3
| |||
| |||
|
|
I have been asked to change a combo box display to sort in alphabetical order. *This is in an app I did not write, but it should be simple enough! ... It is 2 columns, bound column 1, width 0,2". Query: *SELECT Departments.DeptCode, Departments.DeptName FROM Departments ORDER BY Departments.DeptName; ... Any ideas? *Would a decompile be any help at all? *There's lots of code in the app, but little in the form and nothing with this combo box. Thanks - Sara |
#4
| |||
| |||
|
|
sara wrote: Hi - I have been asked to change a combo box display to sort in alphabetical order. *This is in an app I did not write, but it should be simple enough! The combo box is based on a table (and I've put in SQL and a query - same problem) It is 2 columns, bound column 1, width 0,2". Query: *SELECT Departments.DeptCode, Departments.DeptName FROM Departments ORDER BY Departments.DeptName; When I run the SQL or the Query, stand-alone or from the properties window, the sorting is correct (in Dept Name order). The combo box still displays in DeptCode (Number) order. I tried changing the number of rows to display (from 8 to 20) *and the column widths (to .5", 2") and nothing changes in the display! *Still shows 8 rows, in number order. It's like it's not taking my changes or it's getting its direction for the combo box from somewhere else. Any ideas? *Would a decompile be any help at all? *There's lots of code in the app, but little in the form and nothing with this combo box. Thanks - Sara You've verified that the SQL that works (listed above) is the rowsource for the combo? If so, open up the code editor and press CTRL+F and look for * * * * YourComboBoxName.Rowsource = or * * * * .Rowsource = in the form's module. Since you didn't write the app, it is possible that someone updates the rowsource elsewhere. *If you find it, change it to reflect the right SQL statement. Bonafidehttp://www.youtube.com/watch?v=-6IKA0FRpnE- Hide quoted text - - Show quoted text - |
#5
| |||
| |||
|
|
I assume that you're clicking on the rowsource button in the properties window to edit the query, right? Does the row source query change when you save and close the form and then reopen it? If you can change the rowsource to "SELECT Departments.DeptCode, Departments.DeptName FROM Departments *ORDER BY Departments.DeptName;" *but the next time you open the form the order by clause is gone or different I'd look for an "On Open" or "On Activate" event in the form that _may_ be resetting the rowsource. *If the order by clause is there all of the time we've got other problems. A decompile probably wont help, but it couldn't hurt (as long as you have a good backup). hth, tim mills-groninger On Feb 27, 11:12*am, sara <saraqp... (AT) yahoo (DOT) com> wrote: I have been asked to change a combo box display to sort in alphabetical order. *This is in an app I did not write, but it should be simple enough! ... It is 2 columns, bound column 1, width 0,2". Query: *SELECT Departments.DeptCode, Departments.DeptName FROM Departments ORDER BY Departments.DeptName; ... Any ideas? *Would a decompile be any help at all? *There's lots of code in the app, but little in the form and nothing with this combo box. Thanks - Sara- Hide quoted text - - Show quoted text - |
#6
| |||
| |||
|
|
I assume that you're clicking on the rowsource button in the properties window to edit the query, right? Does the row source query change when you save and close the form and then reopen it? If you can change the rowsource to "SELECT Departments.DeptCode, Departments.DeptName FROM Departments *ORDER BY Departments.DeptName;" *but the next time you open the form the order by clause is gone or different I'd look for an "On Open" or "On Activate" event in the form that _may_ be resetting the rowsource. *If the order by clause is there all of the time we've got other problems. A decompile probably wont help, but it couldn't hurt (as long as you have a good backup). hth, tim mills-groninger On Feb 27, 11:12*am, sara <saraqp... (AT) yahoo (DOT) com> wrote: I have been asked to change a combo box display to sort in alphabetical order. *This is in an app I did not write, but it should be simple enough! ... It is 2 columns, bound column 1, width 0,2". Query: *SELECT Departments.DeptCode, Departments.DeptName FROM Departments ORDER BY Departments.DeptName; ... Any ideas? *Would a decompile be any help at all? *There's lots of code in the app, but little in the form and nothing with this combo box. Thanks - Sara- Hide quoted text - - Show quoted text - |
#7
| |||
| |||
|
|
Well, I guess "we've got other problems". * Though I had tried to change other values as well (column widths, rows to display) and they all saved, I again put the SQL statement in the RowSoiurce and tried it again. Not working, and the Order By clause is still there. *I don't see any "Rowsource" in the form (or project) and I don't know what else could change the combo box source. I even opened the table on which the SQL is based and sorted it by name. *That seems to save (still sorted when I reopen the table), but the combo box STILL doesn't sort by name. DeptCode is the primary key to the table. Any thoughts? *It's just the "order by" that I need. * I'll try decompile now anyway. .. |
#8
| |||
| |||
|
|
On Feb 27, 12:48 pm, timmg <tmillsgronin... (AT) gmail (DOT) com> wrote: I assume that you're clicking on the rowsource button in the properties window to edit the query, right? Does the row source query change when you save and close the form and then reopen it? If you can change the rowsource to "SELECT Departments.DeptCode, Departments.DeptName FROM Departments ORDER BY Departments.DeptName;" but the next time you open the form the order by clause is gone or different I'd look for an "On Open" or "On Activate" event in the form that _may_ be resetting the rowsource. If the order by clause is there all of the time we've got other problems. A decompile probably wont help, but it couldn't hurt (as long as you have a good backup). hth, tim mills-groninger On Feb 27, 11:12 am, sara <saraqp... (AT) yahoo (DOT) com> wrote: I have been asked to change a combo box display to sort in alphabetical order. This is in an app I did not write, but it should be simple enough! ... It is 2 columns, bound column 1, width 0,2". Query: SELECT Departments.DeptCode, Departments.DeptName FROM Departments ORDER BY Departments.DeptName; ... Any ideas? Would a decompile be any help at all? There's lots of code in the app, but little in the form and nothing with this combo box. Thanks - Sara- Hide quoted text - - Show quoted text - As you suspected, Decomplie did nothing. Sara |
#9
| |||
| |||
|
|
Hi - I have been asked to change a combo box display to sort in alphabetical order. This is in an app I did not write, but it should be simple enough! The combo box is based on a table (and I've put in SQL and a query - same problem) It is 2 columns, bound column 1, width 0,2". Query: SELECT Departments.DeptCode, Departments.DeptName FROM Departments ORDER BY Departments.DeptName; When I run the SQL or the Query, stand-alone or from the properties window, the sorting is correct (in Dept Name order). The combo box still displays in DeptCode (Number) order. I tried changing the number of rows to display (from 8 to 20) and the column widths (to .5", 2") and nothing changes in the display! Still shows 8 rows, in number order. It's like it's not taking my changes or it's getting its direction for the combo box from somewhere else. Any ideas? Would a decompile be any help at all? There's lots of code in the app, but little in the form and nothing with this combo box. Thanks - Sara |
#10
| |||
| |||
|
|
On Feb 27, 12:48*pm, timmg <tmillsgronin... (AT) gmail (DOT) com> wrote: I assume that you're clicking on the rowsource button in the properties window to edit the query, right? Does the row source query change when you save and close the form and then reopen it? If you can change the rowsource to "SELECT Departments.DeptCode, Departments.DeptName FROM Departments *ORDER BY Departments.DeptName;" *but the next time you open the form the order by clause is gone or different I'd look for an "On Open" or "On Activate" event in the form that _may_ be resetting the rowsource. *If the order by clause is there all of the time we've got other problems. A decompile probably wont help, but it couldn't hurt (as long as you have a good backup). hth, tim mills-groninger On Feb 27, 11:12*am, sara <saraqp... (AT) yahoo (DOT) com> wrote: I have been asked to change a combo box display to sort in alphabetical order. *This is in an app I did not write, but it should be simple enough! ... It is 2 columns, bound column 1, width 0,2". Query: *SELECT Departments.DeptCode, Departments.DeptName FROM Departments ORDER BY Departments.DeptName; ... Any ideas? *Would a decompile be any help at all? *There's lots of code in the app, but little in the form and nothing with this combo box. Thanks - Sara- Hide quoted text - - Show quoted text - As you suspected, Decomplie did nothing. Sara |
![]() |
| Thread Tools | |
| Display Modes | |
| |