473,608 Members | 2,425 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Sort a form by default

Hi all,

I have a form which is based on a table.

The table (table1) has fields like Surname, Firstname, etc.

I want to have the form sort by Surname, and then Firstname.

I put the Orderby files as "table1.surname , table1.firstnam e", and all
is fine. The along comes somebody and clicks a field, and clicks the
A-Z button to sort it by that field, and from then on it is sorted by
that field. I don't want to disable this button as it is useful to
beable to do it to this field, I don't have a way which is just as
easy to sort it by Surname,Firstna me again. If they click on the
Surname field and click A-Z, surname is sorted, but the firstnames if
the surname is the same aren't necessary sorted, and you can't seem to
click to fileds and tell it to sort...

So, can I (somehow) make a button on the form so if they click on
that, it will sort by Surname, Firstname again? and if so... how
(please).

Thanks for reading.
Max.
Nov 12 '05 #1
2 13786
Max Harvey wrote:
Hi all,

I have a form which is based on a table.

The table (table1) has fields like Surname, Firstname, etc.

I want to have the form sort by Surname, and then Firstname.

I put the Orderby files as "table1.surname , table1.firstnam e", and all
is fine. The along comes somebody and clicks a field, and clicks the
A-Z button to sort it by that field, and from then on it is sorted by
that field. I don't want to disable this button as it is useful to
beable to do it to this field, I don't have a way which is just as
easy to sort it by Surname,Firstna me again. If they click on the
Surname field and click A-Z, surname is sorted, but the firstnames if
the surname is the same aren't necessary sorted, and you can't seem to
click to fileds and tell it to sort...

So, can I (somehow) make a button on the form so if they click on
that, it will sort by Surname, Firstname again? and if so... how
(please).

Thanks for reading.

Max.


I'll assume this is a single form or continuous as you can multiselect
columns in a datasheet. You could create a command button then shrink it
down until it's the same height of the surname contol and very narrow.
Maybe put in an S (for sort) as it's caption. Put it to the left of the
label for Surname. In the OnClick event enter
Me.OrderBy = "Surname, FirstName"
Me.OrderByOn = True
Nov 12 '05 #2
Max,
Base the form on a query sorted by LastName, FirstName.
This then becomes the 'normal' sort for the form.

If someone re-sorts, using the A-Z or Z-A toolbuttons,
simply by right-clicking anywhere within the form and selecting
'Remove Filter/Sort' you'll be back where you want to be.
Or ...
you can click on Records + Remove Filter/Sort.

--
Fred

Please reply only to this newsgroup.
I do not reply to personal e-mail.
"Max Harvey" <go****@DELTAL. org> wrote in message
news:7a******** *************** ***@posting.goo gle.com...
Hi all,

I have a form which is based on a table.

The table (table1) has fields like Surname, Firstname, etc.

I want to have the form sort by Surname, and then Firstname.

I put the Orderby files as "table1.surname , table1.firstnam e", and all
is fine. The along comes somebody and clicks a field, and clicks the
A-Z button to sort it by that field, and from then on it is sorted by
that field. I don't want to disable this button as it is useful to
beable to do it to this field, I don't have a way which is just as
easy to sort it by Surname,Firstna me again. If they click on the
Surname field and click A-Z, surname is sorted, but the firstnames if
the surname is the same aren't necessary sorted, and you can't seem to
click to fileds and tell it to sort...

So, can I (somehow) make a button on the form so if they click on
that, it will sort by Surname, Firstname again? and if so... how
(please).

Thanks for reading.
Max.

Nov 12 '05 #3

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

Similar topics

0
1860
by: Shixx | last post by:
Hello, I have problem in my web application and my web form. I have 5-6 buttons (web controls) and when I have focus on some text box, always one button becomes default and got focus, and after I write something in text box and press Enter I invoke that button method ?!?! But this is not button I want to be default. I set tab orders and nothing always that button becomes default when I am on some text box on web form. How can I set default...
88
12429
by: Mike | last post by:
Is there a way to determine what a user's default email client is? I read a post from 3 years ago that said no. I guess I'm hoping something has come along since then.
5
2676
by: serge | last post by:
How can i enter Default Values of " " to all the columns of type character of all the tables (excluding system tables) and Default Values of 0 of all columns of type numbers. Excluding all primary key columns. Thank you
2
2128
by: Yeah | last post by:
I have a simple fill-out form with three fields, in this order: Name, E-mail, and Comment. But when I receive the E-mail containing the form data, the fields are listed backwards (Comment, E-mail, Name). I've checked the CGI file, and it doesn't appear to control the sort order. Is there a way to tell the HTML code to sort the field data for E-mail?
48
4444
by: Alex Chudnovsky | last post by:
I have come across with what appears to be a significant performance bug in ..NET 2.0 ArrayList.Sort method when compared with Array.Sort on the same data. Same data on the same CPU gets sorted a lot faster with both methods using .NET 1.1, that's why I am pretty sure its a (rather serious) bug. Below you can find C# test case that should allow you to reproduce this error, to run it you will need to put 2 data files into current directory...
3
5313
by: afr0ninja | last post by:
Hello! I'm currently working on a form that has several input fields and a subform. What I'm trying to accomplish is that when I first open the form I'd like to have the input fields displayed only. The fields are about 3" wide. Then I'd like to have a command button that when pushed it would expand the form to about 9" displaying the subform along with the input fields. The command button could then be pressed again to shrink the...
49
6076
dima69
by: dima69 | last post by:
Hi all. Here is a problem. I want to sort a form by absolute value. Let's say, if I have a field named "theSum", I'd like to set the form OrderBy property to "Abs()". If I use "Advanced filtering\sorting" from "Records" menu, it works just fine, and OrderBy proprty becomes "Abs()". But when I do the same thing manually or programmatically, it doesn't work. So I cannot figure out what is the trick here and how to make this work.
5
5964
by: Nirmala123 | last post by:
hi... I want to sort the table using combobox values. I give the code here. address.html: <html> <head> <title>Add a new entry</title> </head>
2
3514
by: curran.george | last post by:
'add one textbox to form1 with Control Source property = ID 'copy/paste the form_load code below: 'Then open the form and then attempt to sort the datasheet 'crashes 2003, error 3450 Access 2007 - I can't find much info on this... - Can someone explain what's happening and how to fix this? Private Sub Form_Load() '2008-01-11 Dim rsx As ADODB.Recordset Set rsx = New ADODB.Recordset rsx.CursorLocation = adUseClient
11
1564
by: Ezzz | last post by:
Initially all the assets in my form were ordered by the product Id. (Not set by me suspect it is some sort of default after i downloaded the database?) In order to keep all similar assets together i used the forms "Order By" function in the forms properties box to select "Product Name". This worked well until i tried to get clever and added a serial number search function using an unbound txt box and a command button. Although the search...
0
8010
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8483
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8157
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8349
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6820
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6015
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
3967
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2477
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1336
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.