473,395 Members | 1,568 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

sorting data on continous form

I have a continous form based on 1 table.
On the form I have a button that sets the OrderBy to as follows

DataSource = Me.RecordSource

If Me.OrderBy = DataSource & ".PaymentDate DESC" Then
Me.OrderBy = DataSource & ".PaymentDate"
Exit Sub
End If

Me.OrderBy = DataSource & ".PaymentDate DESC"

This works fine most of the time but sometimes clicking the button doesn't
sort the data. This usually happens after data has been added to the
underlying table and Requery has been run on the form. I can exit the form.
re-open it and click the up or down arrows once then my sort button will
work.

Any ideas on how to make the button work all time?


Dec 15 '06 #1
1 2010
After setting the order, make sure OrderByOn is turned on:
Me.OrderByOn = True

Before it can change the sorting, Access has to save any edits that are in
progress. It is always a good idea to do this explicitly:
If Me.Dirty Then Me.Dirty = False

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Karl" <so*****@sbcglobal.bizwrote in message
news:yO******************@newssvr29.news.prodigy.n et...
>I have a continous form based on 1 table.
On the form I have a button that sets the OrderBy to as follows

DataSource = Me.RecordSource

If Me.OrderBy = DataSource & ".PaymentDate DESC" Then
Me.OrderBy = DataSource & ".PaymentDate"
Exit Sub
End If

Me.OrderBy = DataSource & ".PaymentDate DESC"

This works fine most of the time but sometimes clicking the button doesn't
sort the data. This usually happens after data has been added to the
underlying table and Requery has been run on the form. I can exit the
form. re-open it and click the up or down arrows once then my sort button
will work.

Any ideas on how to make the button work all time?

Dec 15 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: pmud | last post by:
Hi, I am using teh following code for sorting the data grid but it doesnt work. I have set the auto generate columns to false. & set the sort expression for each field as the anme of that...
7
by: Federico G. Babelis | last post by:
Hi All: I have this line of code, but the syntax check in VB.NET 2003 and also in VB.NET 2005 Beta 2 shows as unknown: Dim local4 As Byte Fixed(local4 = AddressOf dest(offset)) ...
0
by: Richard Coutts | last post by:
I have a continous form that has a Query as its source. The form uses 5 fields, two of which are Combo Boxes. When I place the cursor in one of the fields and hit the A>Z sorting button,...
0
by: gavo | last post by:
Hi. using A2K; i have a form containing a continous subform. The question is, how can i call a calculation for one of the fields in the continous subform from the main form. At the moment i...
0
by: Brian Henry | last post by:
Here is another virtual mode example for the .NET 2.0 framework while working with the list view. Since you can not access the items collection of the list view you need to do sorting another...
5
by: jean.ulrich | last post by:
Hi I have a continous form that contain 10 fields I would like to be able to sort 3 fields with a command button example columnA can be 100 or 200 or 300 (there are many records of the same...
3
by: colleen1980 | last post by:
Hi: Can any one please help me when user select 2 dates from DDLDate1 10/09/2006 and DDLDate2 10/12/06 and the name and it close the form. I need to create multiple records in the another table on...
0
by: Karl | last post by:
On on continous form, when I place the cursor anywhere in a field, it highlights all the data to the right of the cursor instead of just placing cursor in the data. I have this form in several...
5
by: AccessHunter | last post by:
Hi, I have a continous form that displays Name and Address of Suppliers. In the form there is a combo box for 'Active Address' and 10 other text boxes. All the fields coem from one table,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.