473,471 Members | 1,733 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

To sort whole table according to a field in ascending order

44 New Member
sir,
i have a table named tblexam.
i want to sort the whole table records according to the field subcode in ascending order.

docmd.runsql "update tblexam order by subcode asc"
But it is showing syntax error.
please help me.
Apr 29 '07 #1
4 3631
ADezii
8,834 Recognized Expert Expert
sir,
i have a table named tblexam.
i want to sort the whole table records according to the field subcode in ascending order.

docmd.runsql "update tblexam order by subcode asc"
But it is showing syntax error.
please help me.
To simply View all Records in tblExam by [subcode] Ascending:
  1. Create a Query called qryExam with the following SQL:
    Expand|Select|Wrap|Line Numbers
    1. SELECT * FROM tblExam ORDER BY tblExam.subcode;
  2. Execute this single line of code to view the results.
    Expand|Select|Wrap|Line Numbers
    1. DoCmd.OpenQuery "qryExam", acViewNormal, acReadOnly
Apr 29 '07 #2
neelesh kumar
44 New Member
sir,
The query you had given is working It is giving result with the records in ascending order. i want to update my table tblexam.After running that query my table is not updated.
how to do this
please help me.
Apr 30 '07 #3
pks00
280 Recognized Expert Contributor
Do you mean you want the records in your table sorted in that order?

Why would u want to do that, u simply need to write a query as already shown and that is it.
Apr 30 '07 #4
neelesh kumar
44 New Member
sir,
yes, i mean the table named tblexam records to be sorted in that order.
i need it because
in the table fields are sno,questionno,subcode,question,option1,option2,op tion3,option4,answer.
I have a form created using wizard from that tblexam.
In the form add,delete,...command buttons are there.
when i add a question related to subcode (say mat) that record has to go to the table after the subcode (mat) last record instead of the last record in the table.so i want to sort every time on basis of subcode the whole table when we add,delete records so that the records will be in ascending order on the basis of subcode.
Apr 30 '07 #5

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

Similar topics

2
by: Alpay Eno | last post by:
Hello all... I'm using asp to get records from an access database, very similar to the way datagrid would work. The title of each column in my table is a link that alternates the sort order between...
11
by: James P. | last post by:
Hello, I have a report with the Priority field is used as sort order and grouping. The problem is the data in this Priority field if sorted in ascending order is: High, Low, and Medium. How...
2
by: Deano | last post by:
If I sort my table on a date in ascending order then empty dates are listed first; SELECT tblReview.ID, tblReview.ReviewDate, tblReview.NextReview FROM tblReview ORDER BY tblReview.NextReview; ...
1
by: deko | last post by:
I need to import dates from a linked table then export them out as text to an Excel spreadsheet. The problem is the dates need to be in ascending order when I dump them out to Excel - and there's...
7
by: DC Gringo | last post by:
I have a datagrid that won't sort. The event handler is firing and return label text, just not the sort. Here's my Sub Page_Load and Sub DataGrid1_SortCommand: -------------------- Private...
1
by: Gunjan Garg | last post by:
Hello All, I am working to create a generic datagrid which accepts a datasource(ListData - This is our own datatype) and depending on the calling program customizes itself for sorting,...
11
by: Alan T | last post by:
Does the ListView supports sort? I want to have a up/down arrow/triangle that show it is sorted asc or desc on the column headers when I click the column header. May be I need a third-party...
9
by: Troy | last post by:
Public Sub test() DoCmd.OpenTable ("OSM Table 1") End Sub Amazingly, I've gotten this far, now I am wondering how to sort the database in ascending order according to field called and...
3
by: usaccess | last post by:
Hi, I have a form/subform. There is a priority field and then a case status field. I want to display records so that it sorts by case status as "actives" then "on holds" then "completes" and...
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
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,...
1
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,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.