dbTalk Databases Forums  

Combo Box based on Query sort not working - A2K

comp.databases.ms-access comp.databases.ms-access


Discuss Combo Box based on Query sort not working - A2K in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #11  
Old   
sara
 
Posts: n/a

Default Re: Combo Box based on Query sort not working - A2K - 02-28-2008 , 06:28 AM






On Feb 27, 4:56*pm, lyle fairfield <lylef... (AT) yah00 (DOT) ca> wrote:
Quote:
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 -
Thank you ALL for the suggestions - I found the problem, thanks to
everyone!

I decided to rebuild the form, but start with just the one combo box.
It turns out there are 2 combo boxes, one on top of the other, where
one has the word "Orig" in its name and the other does not.

I had only changed the row source of the "hidden" combobox(it is the
combo box on "top", but "Visible" is set to "no").

Once I started trying to copy the combobox and paste it on the form
(to "save" it), I started seeing the other field and eventually
figured it all out.

MANY MANY thanks - I should now know to delete an offending combo box
or rebuild a form.

Sara


Reply With Quote
  #12  
Old   
sara
 
Posts: n/a

Default Re: Combo Box based on Query sort not working - A2K - 02-28-2008 , 06:30 AM






On Feb 27, 4:38*pm, "Dominic Vella" <dominic.ve... (AT) optusnet (DOT) com.au>
wrote:
Quote:
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 -
Thanks. I had searched for all sorts of things, but as you'll see my
(final) response, I found it was a "non" visible combo box on top of
the visible one.

All set.
sara


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.