Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / March 2007

Tip: Looking for answers? Try searching our database.

Order By question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Becky - 18 Mar 2007 21:27 GMT
hi

My table has 3 fields (DivID, DivName, DivCode).  I made a query based on
the same three fields, sorted by DivName ascending.

My form is based on the query and has a combo box for DivID(0 width) and
DivName.  As desired, the combo box displays its DivName records in alpha
order.  

Here is my question.  I thought I'd ditch the query and use the table as the
form's recored source, but I can't get the form's Order By property to work??
Whan I set it to Order By DivName, the combo still uses the tables original
order.  Am I missing something?

Thanks
Douglas J. Steele - 18 Mar 2007 21:53 GMT
The form's OrderBy property has nothing to do with the sort order of the
records in the combo box.

Rather, you need to ensure that the combo box's RowSource is a query with
the appropriate ORDER BY clause.

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)

> hi
>
[quoted text clipped - 14 lines]
>
> Thanks
Becky - 18 Mar 2007 22:24 GMT
Thanks Douglas and Rick for the timely reply.  Actually, I made a mistake
when I posted my question.  The records I want to use ORDER BY on are in a
textbox, not a combo box as I stated.  The field is called DivName, but when
I set the continuous form's ORDER BY to DivName, the records still appear in
the order they are in the original table.  Any possible explanation?

Thanks

> The form's OrderBy property has nothing to do with the sort order of the
> records in the combo box.
[quoted text clipped - 20 lines]
> >
> > Thanks
Rick Brandt - 18 Mar 2007 22:29 GMT
> Thanks Douglas and Rick for the timely reply.  Actually, I made a mistake
> when I posted my question.  The records I want to use ORDER BY on are in a
> textbox, not a combo box as I stated.  The field is called DivName, but when
> I set the continuous form's ORDER BY to DivName, the records still appear in
> the order they are in the original table.  Any possible explanation?

You also have to set OrderByOn to True.  It is actually better to just bind the
form to a simple query that has the order by  clause that you want.

Signature

Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt   at   Hunter   dot   com

Becky - 18 Mar 2007 23:37 GMT
Yes, that's it.  I didn't know about the OrderByOn being set as well.  Thanks
to Rick & fredg
fredg - 18 Mar 2007 23:00 GMT
> Thanks Douglas and Rick for the timely reply.  Actually, I made a mistake
> when I posted my question.  The records I want to use ORDER BY on are in a
[quoted text clipped - 28 lines]
>>>
>>> Thanks

How are you setting the form's Order By?
What do you actually do?

After you set the form's sort order to [DivName] did you set the
Form's OrderByOn = True by right-clicking on the form and selecting
Apply Filter/Sort?
Signature

Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail

Rick Brandt - 18 Mar 2007 21:56 GMT
> hi
>
[quoted text clipped - 11 lines]
>
> Thanks

The RowSouce of your ComboBox has nothing at all to do with the RecordSource of
your form. You would never expect one to have an effect on the other.

In most cases they would be looking at completely separate tables.

Signature

Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt   at   Hunter   dot   com

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.