473,406 Members | 2,847 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,406 software developers and data experts.

Run time sorting on tabular form by cliciking labels

16
HI there
i have this kind of employee list form in my database

select flag first name lastname dob
x xxxxx xxxxxx xxxxxxxx
x xxxxx xxxxxx xxxxxxxx
x xxxxx xxxxxx xxxxxxxx
x xxxxx xxxxxx xxxxxxxx

i wnat to do sorting of records on a tabular form by clicking on the header label of each field like first name or last name.This form is based on a query which is sorted by lastname.do i need to make different quries for each sorting.I think i can do it by orderby feature but i don'n know how to implement this in coding.
Thanks in advance
Jun 27 '08 #1
2 1902
wassimdaccache
222 100+
use this code
Expand|Select|Wrap|Line Numbers
  1.     1.
  2.       Private Sub btnSortAsc_Click()
  3.    2.
  4.           'sets focus to previously active control as the current is [btnSortAsc]
  5.    3.
  6.           Application.Screen.PreviousControl.SetFocus
  7.    4.
  8.           'perform ascending sort command
  9.    5.
  10.           DoCmd.RunCommand acCmdSortAscending  ' or acCmdSortDescending
  11.    6.
  12.       End Sub


on the labeb properties got to onclick event and insert this code.

NB: you have to get focus on the field to sort .E
WASSIM S DACCACHe
Jun 27 '08 #2
sam12
16
Thanks wassim for ur reply
this code helped me to do sorting

Me.OrderBy = "Control_Name" 'or = "tablename.fieldname"
Me.OrderByOn = True
Jun 27 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

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)) ...
11
by: rkbnair | last post by:
I have created a datagrid in my aspx with the 'AllowSorting' property to true. When clicking on the column header, the page refreshes. However the sorting is not done. Am I missing anything? I...
8
by: whodunit | last post by:
What is the difference in development time, if you can use a rule of thumb, between ASP and ASP.NET? I have read many places that ASP.NET makes you more productive? Well, by how much? I hear...
19
by: Owen T. Soroke | last post by:
Using VB.NET I have a ListView with several columns. Two columns contain integer values, while the remaining contain string values. I am confused as to how I would provide functionality to...
0
by: Lumpierbritches | last post by:
Thank you in advance for your assistance. Is there a way in VB.net to make a subform that is continuous in a tabular format? In other words, can I create two forms and have one of the forms be a...
5
by: jcrouse | last post by:
Many of you who may respond to this are somewhat familiar with my app in process (Cor). Simply, it's a form with 30 labels that is triggered from another application, with a hotkey. The labels text...
4
by: Eric | last post by:
How to i create a form in tabular format without using wizard. thanks,
1
by: CrazeUK | last post by:
Hi, First thanks in advance. I am using the board quite frequently now. I have a DB with multiple tables. Table 1: Main details table Table 2: Notes Table 3: Files affected I want to be able...
38
by: Sanders Kaufman | last post by:
I'm converting my table-based layouts to css-positioned divs - but the ONLY reason I'm doing it is because it's *considered* a best practice. I don't really see where anything goes hinky when...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.