Can't sort

  • Thread starter Thread starter PayeDoc
  • Start date Start date
P

PayeDoc

Hello all

I have a textbox on a form with the following control source:

=DMax("[tblEmailLogs]![dteSend]","[tblEmailLogs]","[tblEmailLogs]![txtEmailT
o] = And ([tblEmailLogs]![txtSubject] Like ""*""&'pridoc'&""*""
or [tblEmailLogs]![txtSubject] Like ""*""&'electronic'&""*"")")

The expression works fine, in that it gives the correct result every time,
but I can't sort on it - the only right-click option that isn't greyed out
is "Remove filter/sort". All the other texboxes on the form are fine.

Any ideas?

Many thanks
Les
 
Leslie,

I've been thinking about your sorting problem. I don't think you can sort on
a calculated control.... there is nothing in the table or query (a 'virtual'
table) to sort by.

Try moving the DMAX() function to the query, then binding the text box to
the field in the query. You should then be able to do the sorting. (I hope)

HTH
 
Hello Steve

Many thanks for your reply.
I'll try your suggestion - sounds like it might do the trick: I'll let you
know if it doesn't!

Les

Steve Sanford said:
Leslie,

I've been thinking about your sorting problem. I don't think you can sort
on
a calculated control.... there is nothing in the table or query (a
'virtual'
table) to sort by.

Try moving the DMAX() function to the query, then binding the text box to
the field in the query. You should then be able to do the sorting. (I
hope)

HTH
--
Steve S
--------------------------------
"Veni, Vidi, Velcro"
(I came; I saw; I stuck around.)


PayeDoc said:
Hello all

I have a textbox on a form with the following control source:

=DMax("[tblEmailLogs]![dteSend]","[tblEmailLogs]","[tblEmailLogs]![txtEmailT
o] = And ([tblEmailLogs]![txtSubject] Like ""*""&'pridoc'&""*""
or [tblEmailLogs]![txtSubject] Like ""*""&'electronic'&""*"")")

The expression works fine, in that it gives the correct result every
time,
but I can't sort on it - the only right-click option that isn't greyed
out
is "Remove filter/sort". All the other texboxes on the form are fine.

Any ideas?

Many thanks
Les



.
[/QUOTE][/QUOTE]
 
Back
Top