LIKE function in a Query (1 Viewer)

Marbinski

Registered User.
Local time
Today, 11:01
Joined
Aug 24, 2004
Messages
45
I have a form (FRM_X) that that has a text box w/ the primary key value (Dir Num). I also have a subform inside FRM_X called FORM_X_sub.

I am trying to create a query for the subform that retrieves records like the value in the Dir Num text box.

My main concern is that I also have several other forms similar to FRM_X. Is there away to change this code to say "i want all values like Dir Num in current form". Reason why I ask is because I would not like to create several of the same queries w/ slight modifications. I just want one query vs. many.

I have come up with this for the criteria input:

QRY 1: Like ([FORMS]![FRM_X].[Dir Num])

My idea: "Like ([Current Form].[Dir Num])" --> im looking for syntax???

I hope I explained this correctly, so if anyone can give any tips or solutions please help, thanks.
 

dcx693

Registered User.
Local time
Today, 14:01
Joined
Apr 30, 2003
Messages
3,265
If you save the code in the subform and will be pulling up the subform as a subform for multiple main forms which are all like FRM_X, you can use the Me.Parent.Form.Name property to retrieve the name of the parent form.
 

Users who are viewing this thread

Top Bottom