sort on form

P

Pammy

On one of our forms, sometimes a user will try to sort on a field, the next
thing an OBDC error pops us stating that text, ntext and image data types
cannot be used in an ORDER BY clause. When I go to the properties of the
form, Data tab, and on the Order by: [Suspect Comparisons].SC_Narrative.
When I remove the SC_Narrative and change this back to SC_Incident#, the OBDC
goes away. Its like when they do a sort from the form, it tries to sort the
narrative.

Is there any way I can keep the users from sorting on the form? This would
help, since we have at least 15 people who use this.
 
T

Tom van Stiphout

On Fri, 5 Dec 2008 10:19:02 -0800, Pammy

Sure. Here is one way:
In the Form_ApplyFilter event, write:
End

Another more user-friendly way is in the same event write:
If Instr(Me.Filter, "SC_Narrative") > 0 then
Msgbox "Yo! Kindly don't search on memo fields!", vbExclamation
Cancel = True
End If

-Tom.
Microsoft Access MVP
 

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