Calculated controls - sorting (2007)

Calculated controls - sorting (2007)

Postby Egg 'n' Bacon » 18 May 2010, 10:29

OK, here's the next one :)

I have a form based on a table with a couple of text boxes that are populated with calculations from other fields (i.e. TxtTgtClosure equals [DateRaised]+5).

On request, I have put ASC & DESC sort buttons for each field, but those for the calculated controls do not work.

Here's an example of the code I'm using;
Code: Select all
    Me.OrderByOn = False
    Me.OrderBy = "TxtTgtClose"
    Me.OrderByOn = True


BTW, both calculated controls are based on Date fields
Post=16632
Egg 'n' Bacon
3StarLounger
 
Posts: 398
Joined: 18 Mar 2010, 11:05

Re: Calculated controls - sorting (2007)

Postby Egg 'n' Bacon » 18 May 2010, 11:16

Ah, sorted it; I needed to base the form on a query with the calculations in that.
Post=16637
Egg 'n' Bacon
3StarLounger
 
Posts: 398
Joined: 18 Mar 2010, 11:05

Re: Calculated controls - sorting (2007)

Postby HansV » 18 May 2010, 11:23

Yep - you can't sort on a calculated control, but you can sort on a calculated field from the record source.
Regards,
Hans
Post=16640
User avatar
HansV
Clever Clogs
 
Posts: 24121
Joined: 16 Jan 2010, 00:14
Location: Leiden, The Netherlands


Return to Access/SQL

Who is online

Users browsing this forum: Google [Bot] and 2 guests

cron