DoCmd.Find Alternative

JamesJoey

Registered User.
Local time
Today, 18:42
Joined
Dec 6, 2010
Messages
642
I use the DoCmd.Find to find text on a split form.
First after I type in the string but before I click Find Next I must click on the field I want to search in if it doesn't already got the focus.
Otherwise, I get no message, or anything.

For instance:
I have a DVD library with a memo field (which I do most of my searching on) that lists the episodes of the Honeymooners.
One episode is titled "Suspense." The text in the memo field is "Suspense:" with the description of the episode.
If I search "Suspense" I get no results, nothing. But if I place the semicolon (suspense:) it finds it. I have the match set to 'Any part of field.'

Shouldn't it find the text with out the semicolon.
Maybe I shouldn't be using these split forms, they become a pain.

Is there any code to replace the DoCmd.Find??


Thanks,
James
 
I doubt very seriously that the problem, here, is the Split Form, but rather suspect that problem is caused by the manner in which you're using Memo Fields!

One of the Cardinal rules to having a well designed, normalized database is that no single field will contain more than one individual piece of data. Data stored in Memo fields should be restricted to "notes" or narrative type information, such as a salesman's notes on a customers, a doctor's progress notes on patients, or, as in your case, notes on the episodes.

In this case you should have a Main Form with the title of the program/show as well as other pertinent information, and a Subform containing a Record for each individual episode. This Record should have a Field dedicated to the episode title, as well as individual Fields for other data, and reserve the Memo Field for a description of the episode...nothing else! You'd then search on the episode title Field.

To put it simply...you should never, never, never place data in a Memo field if there any possibility that you will ever need to search, sort, parse or in any other way manipulate the data! Memo Fields are not designed for use with these types of Functions, and doing so can lead to unpredictable results, as you've experienced!

Because many Queries perform some of these functions, you have to take care in using them in Queries or they will likely be truncated to 255 characters.

Allen Browne has some excellent advice explaining how to deal with Memo Fields and Queries:

Microsoft Access tips: Truncation of Memo fields

Linq ;0)>
 
Last edited:
Are you using DoCmd.RunCommand acCmdFind? On my Access 2013 system it finds suspense within suspense: If will also find suspense if I put pens in the Find What:
 
Yes. This would normally be done in a Main Form/Subform scenario, in a one-to-many relationship. The 'one' side would be for data for the show/program, itself, while the 'many' side would have multiple Records, each one holding data for a single episode.

Linq ;0)>
 

Users who are viewing this thread

Back
Top Bottom