workaround to set "Search Fields as Formatted"

G

Gordon Prince, MCP

I saw several posts in this newsgroup about Access 2002/2003 having the "Search Fields as Formatted" checkbox checked by default. But no one seemed to have a way to set it.

I tried this and it works.
Application.Echo False
DoCmd.OpenForm strStaff
DoCmd.FindRecord "StaffID='AP'", acStart, False, acSearchAll, False, acCurrent, True
DoCmd.Close acForm, strStaff, acSaveNo
Application.Echo True

It looks like setting any of these arguments once leaves them set as long as the application is open. The fifth argument to the FindRecord is "SearchAsFormatted". False clears the checkbox.

I added the code to my application's startup form's Open event.
 
V

Van T. Dinh

See the MSDN article:

http://msdn.microsoft.com/library/en-us/dnacc2k/html/acglobaloptions.asp?

--
HTH
Van T. Dinh
MVP (Access)


I saw several posts in this newsgroup about Access 2002/2003 having the "Search Fields as Formatted" checkbox checked by default. But no one seemed to have a way to set it.

I tried this and it works.
Application.Echo False
DoCmd.OpenForm strStaff
DoCmd.FindRecord "StaffID='AP'", acStart, False, acSearchAll, False, acCurrent, True
DoCmd.Close acForm, strStaff, acSaveNo
Application.Echo True

It looks like setting any of these arguments once leaves them set as long as the application is open. The fifth argument to the FindRecord is "SearchAsFormatted". False clears the checkbox.

I added the code to my application's startup form's Open event.
 

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