![]() | |
![]() |
| | Thread Tools | Display Modes |
#11
| |||
| |||
|
|
sara <saraqp... (AT) yahoo (DOT) com> wrote innews:6430ce69-bff5-449e-ba5d-0ef6bd6238d5 (AT) 60g2000hsy (DOT) googlegroups.com: 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 For openers I would: A: Make a copy of the form for safety. Run this code: SaveAsText acForm, "NameofForm", "NameofForm.txt" LoadFromText acForm, "NameofForm", "NameofForm.txt" Maybe the combobox will work now. If not then B: Find the file "NameofForm.txt". Open it in Notebook. Copy the text. Post it here. If we find the problem we'll tell you. If we don't it means the porblem is somewhere else. We'll tell you how to look for that too. or C: You will have found a bug in Access and be famous; or D: Shut up, Lyle!- Hide quoted text - - Show quoted text - |
#12
| |||
| |||
|
|
The Rowsource is found in the properties for the Combo Box, not the form. It may be best to open the VB Editor for the form and search for "order". That may be a clue to what's causing the rewrite. Dom"sara" <saraqp... (AT) yahoo (DOT) com> wrote in message news:5ece8a5b-961e-4714-8df8-5923ea38706c (AT) x41g2000hsb (DOT) googlegroups.com... 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- Hide quoted text - - Show quoted text - |
![]() |
| Thread Tools | |
| Display Modes | |
| |