Can't sort

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
 
S

Steve Sanford

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
 
L

Leslie Isaacs

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]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top