"Similar beginning" Criteria for a query

MoxieCraz

Registered User.
Local time
Yesterday, 19:51
Joined
Jun 8, 2010
Messages
29
In my form I have a subform. I want the subform to be linked to the form by the record's description...but only if the description beginning is similar. For example:
If I have a records with the following description: Ice Breakers; Ice Breakers II; Ice Breakers Return; Jokes.

If I was on the Ice Breakers II record, the subform would list the Ice Breakers and Ice Breakers Return records, but not Jokes. I currently have the Master/Child linked on description, but it has to have identical descriptions for it to work. Is there a way to have, say, the first 10 characters matched, then it would show up on the list?

Does this make sense?
 
In my form I have a subform. I want the subform to be linked to the form by the record's description...but only if the description beginning is similar. For example:
If I have a records with the following description: Ice Breakers; Ice Breakers II; Ice Breakers Return; Jokes.

If I was on the Ice Breakers II record, the subform would list the Ice Breakers and Ice Breakers Return records, but not Jokes. I currently have the Master/Child linked on description, but it has to have identical descriptions for it to work. Is there a way to have, say, the first 10 characters matched, then it would show up on the list?

Does this make sense?

Look up the Left() Function. It can be used to get you the first 10 characters of a String. What you are able to do with it after that will depend on your needs. I do not believe that a "Like" feature is available in this context.
 
A linked field will be an exact match. However, you could set the recordset of the subform to "" when the main form is loaded and then create the recordset when the load is complete. In this case, you wouldn't link the fields, you would simply be creating the proper recordset as you open the form. You could still change records and refresh by resetting the recordset with custom navigation buttons.

Linked forms are great for some things, but I have found that programatically controlling subforms works better for anything outside of the basic links.
 
Thank you for the input. What I did was did the Left () function on the Main Form query and on the child subform and linked the two...works great!!! Thanks for your help!
 

Users who are viewing this thread

Back
Top Bottom