473,394 Members | 1,701 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,394 software developers and data experts.

Displaying data that has been sorted in a list box

Hello,

I have a form which has a option group, when a option in the group is selected it brings up a text box, you then enter a parameter into that text box and the data should be sorted out according to the parameter.

eg select sort by date in option group, date text box appears you then enter the date you want data to be sorted to, that data on that date is displayed in a list box.

I am currently using code below but nothing seems to be happening. I select the option group and text box appear and then I enter the date but nothing happens. All I would like is the data in a table sorted by date or unit selected and then displayed in a list box, any suggestions?

Private Sub Optiongroup_AfterUpdate()

Select Case Me.Optiongroup
Case 2 'Order by Date

Me.TextBoxDate.Visible = True
Me.TextBoxUnit.Visible = False

Case 3 'Order by Unit

Me.TextBoxUnit.Visible = True
Me.TextBoxDate.Visible = False

Case Else

Me.TextBoxUnit.Visible = False
Me.TextBoxDate.Visible = False

End Select

End Sub

Private Sub TextBoxDate_AfterUpdate()


Select Case Me.Optiongroup
Case 2 'Order by Date

order = "Date"
Me!Result.RowSource = "QueryDate"
Source = "QueryDate"
Result.Requery

Case 3 'Order by Unit

order = "Unit"
Me!Result.RowSource = "QueryUnitNo"
Source = "QueryUnitNo"
Result.Requery

Case Else

End Select

End Sub
Oct 23 '07 #1
1 1331
nico5038
3,080 Expert 2GB
Much work, while the right-click popup form already offers this possibility:
http://www.geocities.com/nico5038/xR...nstruction.zip

For changing the order of an active form you'll have to use:
Expand|Select|Wrap|Line Numbers
  1. Me.OrderBy = "DateField"
  2. Me.OrderByOn = True
  3.  
Best not to use "Date" as fieldname, as it's also an Access function (and thus a reserved word).

Nic;o)
Oct 24 '07 #2

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

Similar topics

5
by: Robert | last post by:
Hello Accessors I have some reports created in Access that are very good for what they do. However, it seems to me that when you are displaying information you don't need to print out that a...
5
by: tdmailbox | last post by:
I have a form with a child form. In the child form there is a list of names that can grow quite large. On the parent form I want to display the first name from the child form. I set up a test...
1
by: J L | last post by:
I want to create a sorted list whose values are themselves sorted lists. I wrote the following simple test program but it does not behave as I would expect. What I wanted to do was have the...
4
by: shrishjain | last post by:
Hi All, I need a type where I can store my items in sorted order. And I want to keep adding items to it, and want it to remain sorted. Is there any type in .net which I can make use of. I see...
5
KevinADC
by: KevinADC | last post by:
Introduction This discussion of the sort function is targeted at beginners to perl coding. More experienced perl coders will find nothing new or useful. Sorting lists or arrays is a very common...
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...
3
KevinADC
by: KevinADC | last post by:
If you are entirely unfamiliar with using Perl to sort data, read the "Sorting Data with Perl - Part One and Two" articles before reading this article. Beginning Perl coders may find this article...
0
by: coolsti | last post by:
To the more experienced C# programmers, how do I do this best? I have a 2 dimensional mapping of values in a database, which represent a somewhat round (but not exactly round) shape when drawn out...
1
by: Harold Howe | last post by:
Howdy all, The msdn help says this about SorteList<k,v>: "If the list is populated all at once from sorted data, SortedList is faster than SortedDictionary." My question is this: how do I...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...

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.