Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calulated field 1

Status
Not open for further replies.

kastaman

IS-IT--Management
Sep 24, 2001
181
CA
Hi there,

Can I get some help in writing the proper scrirt for the the folllowing requirement:

we would like to have the ability to sort our investigations by date completed:
Ascending, decending and blank (open).

I've set a event proc. on the header for:
click - sort asc.
dbl click - sort dec.

I need a way to sort by open investigation, I thought of creating an unbound control where if the date completed is blank, it'll give a 1 or 0 then I can set the proper sorting.

Please advise on:
Is there a better way to configure my sorting requirements?
Can one provide a script for my control box depending on the date complete field to = either yes or no.

Thanks,

Kastaman
 
Instead of the click / dbl click events, I would use a frame and some option buttons. With ascending, your open investigations will automatically be at the top. (There's no need to sort "blank" - however you may want to filter your results.)

Sort of like this:
Code:
 ---[Sort]---------
O Ascending
O Descending
--------------
A little knowledge is a dangerous thing.
 
MisterC,

I think that'll be a better option for the user, do I need a specific event proc. for this to work, if so can you assist?

Kastaman
 
Add a frame to your form header. If you use the Wizard, it will prompt you for the selections you want - just enter "Ascending" and "Descending". You can take the default values for the choices. (i.e. 1 for Ascending and 2 for Descending)

Put the following code in the Frame's AfterUpdate event:
Code:
    'Which option is selected?
    'This assumes your frame is called "Frame1"
    Select Case Me.Frame1.Value
    
        Case 1 'Ascending
        Me.OrderBy = "
Code:
FieldName
Code:
 ASC"
        
        Case 2 'Descending
        Me.OrderBy = "
Code:
FieldName
Code:
 DESC"
        
    End Select
    
    'Make sure OrderByOn is turned on
    Me.OrderByOn = True
--------------
A little knowledge is a dangerous thing.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top