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

sorting

56
I have a text box and the control souce says:

=fCntProdRec([Prodcd]

I have a label that I want the users to be able to click on that will sort this text box in descending and ascending order, but I am not show to do that when the control source is setup this way.

I had to take it out of the query that I was running where I had xx:fCntProdRec([Prodcd]) and then I could sort by referencing the xx.
Expand|Select|Wrap|Line Numbers
  1. Static blFlag As Boolean
  2. Me.OrderByOn = True
  3. If blFlag = False Then
  4. Me.OrderBy = "[xx]"
  5. Else
  6. Me.OrderBy = "[xx]desc"
  7. End If
  8. blFlag = Not blFlag
  9. End Sub
but it was causing the form to load so slow and changing it to the the above way has improved the response time. Just not sure how to sort now.
Mar 22 '07 #1
4 1615
NeoPa
32,556 Expert Mod 16PB
This is difficult to understand as you don't explain what you're referring to. I guess there's some sort of Form or Report involved but I can't work trying to guess what you should have said in your explanation. If you can manage to make the question clear, I'll see what I can do to help.
Mar 23 '07 #2
MMcCarthy
14,534 Expert Mod 8TB
I have a text box and the control souce says:

=fCntProdRec([Prodcd])

I have a label that I want the users to be able to click on that will sort this text box in descending and ascending order, but I am not show to do that when the control source is setup this way.

I had to take it out of the query that I was running where I had xx:fCntProdRec([Prodcd]) and then I could sort by referencing the xx.
Expand|Select|Wrap|Line Numbers
  1. Static blFlag As Boolean
  2. Me.OrderByOn = True
  3. If blFlag = False Then
  4. Me.OrderBy = "[xx]"
  5. Else
  6. Me.OrderBy = "[xx]desc"
  7. End If
  8. blFlag = Not blFlag
  9. End Sub
but it was causing the form to load so slow and changing it to the the above way has improved the response time. Just not sure how to sort now.
Is the textbox still named [xx]?
Mar 25 '07 #3
camp
1
I just want to say THANK YOU! Your post has allowed me to solve a problem that his been plaguing me for three days, i.e. getting a form to open in a particular sort order regardless of how the users may have sorted it in the past. That is to say, I needed the form to open in a "default" sort order and not the last saved sort order.

My OnOpen event procedure now has lines 2 & 4 of your code:

Me.OrderByOn = True
Me.OrderBy = "[myfieldname]"

It works BEAUTIFULLY, so THANK YOU!

I hope your problem was also solved satisfactorily.
May 29 '07 #4
NeoPa
32,556 Expert Mod 16PB
Well Camp, I have to say it was nice of you to register as a member just to come in and say thanks to Favor. Good for you. I hope you find much more of interest and of use in The Scripts :)
May 30 '07 #5

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

Similar topics

4
by: dont bother | last post by:
This is really driving me crazy. I have a dictionary feature_vectors{}. I try to sort its keys using #apply sorting on feature_vectors sorted_feature_vector=feature_vectors.keys()...
0
by: ck388 | last post by:
For some reason when I enable the callback feature of the gridview I still get a page refresh, that is it seems like there is a postback that occurs, not a callback which is just supposed to update...
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)) ...
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...
10
by: Sjaakie | last post by:
Hi, I'm, what it turns out to be, fooling around with 3-tier design. At several websites people get really enthusiastic about using custom dataobjects instead of datasets/-tables. While trying to...
4
by: Ambica Jain | last post by:
Hi, I want custom sorting on some of the columns in the datagrid. And i am able to do the same by overriding MouseDown event. However, i need to rebind my datatable to reflect the changes in...
7
by: Kamal | last post by:
Hello all, I have a very simple html table with collapsible rows and sorting capabilities. The collapsible row is hidden with css rule (display:none). When one clicks in the left of the...
1
KevinADC
by: KevinADC | last post by:
Introduction In part one we discussed the default sort function. In part two we will discuss more advanced techniques you can use to sort data. Some of the techniques might introduce unfamiliar...
5
by: lemlimlee | last post by:
hello, this is the task i need to do: For this task, you are to develop a Java program that allows a user to search or sort an array of numbers using an algorithm that the user chooses. The...
5
by: jrod11 | last post by:
hi, I found a jquery html table sorting code i have implemented. I am trying to figure out how to edit how many colums there are, but every time i remove code that I think controls how many colums...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.