Search query problem (1 Viewer)

Jgr4ng3

Registered User.
Local time
Today, 19:20
Joined
Jan 19, 2013
Messages
62
Hello

I have several search functions in my db but I fear this one has beaten me.

I have a form, which contains a subform, which contains a subform, which contains the form 'Search Call-backs'. Within this form are several fields that the user can enter data into to conduct a search of the db to retrieve relevant records.

The criteria I need to use should be something like..
Code:
Like "*" & [Forms]![Navigation Form]![NavigationSubform]![Navigationsubform]![Search Call-backs]![Surname] & "*"
.. however this returns ALL results, despite data being in the Surname field, which is obviously incorrect.

I have tried opening the form directly rather than via the subform and using
Code:
Like "*" & [Forms]![Search Call-backs]![Surname] & "*"
and this works fine. As does just putting the name in asterisks..

If I try amending the path (incase I got it wrong!) by removing one of the NavigationSubforms, or adding another one, it acts as a parameter asking me for that field...

Any help would be appreciated!
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 14:20
Joined
Feb 19, 2002
Messages
43,782
Try fixing your syntax to include the form property.

Like "*" & [Forms]![Navigation Form].Form![NavigationSubform].Form![Navigationsubform].Form![Search Call-backs]![Surname] & "*"
 

Jgr4ng3

Registered User.
Local time
Today, 19:20
Joined
Jan 19, 2013
Messages
62
Try fixing your syntax to include the form property.

Like "*" & [Forms]![Navigation Form].Form![NavigationSubform].Form![Navigationsubform].Form![Search Call-backs]![Surname] & "*"

Hi Pat,

Thanks for your suggestion, I've tried this and still no luck!

I dont understand, there is no reason for it not to work as far as I can see...

Cheers.
 

Jgr4ng3

Registered User.
Local time
Today, 19:20
Joined
Jan 19, 2013
Messages
62
I just tried renaming the form to [SearchCall-backs] to see if it helped to no avail. I then tried [Searchcallbacks] which still didnt work.. Really not seeing the problem here!
 
Last edited:

Pat Hartman

Super Moderator
Staff member
Local time
Today, 14:20
Joined
Feb 19, 2002
Messages
43,782
Please post the code. I made a typo in my example and gave the subform and subsubform the same name.
 

Jgr4ng3

Registered User.
Local time
Today, 19:20
Joined
Jan 19, 2013
Messages
62
Please post the code. I made a typo in my example and gave the subform and subsubform the same name.


Code:
Like "*" & [Forms]![Navigation Form].[Form]![NavigationSubform].[Form]![NavigationSubForm].[Form]![SearchCallbacks]![Surname] & "*"
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 14:20
Joined
Feb 19, 2002
Messages
43,782
You have NavigationSubform listed twice.
 

Users who are viewing this thread

Top Bottom