Solved Open form and filter

theinviter

Registered User.
Local time
Today, 00:23
Joined
Aug 14, 2014
Messages
273
Dear all;
I have a form that upon double click on list open another form and filter it,
i tried below code but not working

DoCmd.OpenForm "MRN_Query1_Delivered", acNormal, , "[Item Code] = '" & Me.List6 & "' and [Location - Clinics Code] = MRN_Query1_subform.[Location_Code] & "

item code is text
and location code is number

can you please advise me
 
Hi. Is location code in a subform? If so, try adding "Form" to the syntax. For example:

... AND [Location - Clinics Code] = Me.MRN_Query1_subform.Form!Location_Code
 
if you are trying to open a form using another forms' subform value then, note the [subform Name], then [.Form], then [form object]

sFltr ="[field]='" & me.subform.form.txtLineCode & "'"
docmd.openform "fMy2ndForm",,,sFltr

use the BUILDER, it always gets the path correct.
 

Users who are viewing this thread

Back
Top Bottom