ChuckRush
asked on
Filter on Mulltiple fields
I have a su form that i am trying to filter on multiple fields. The filter is not be accepted. I trynig to set the filer in the 'On Load' event. The syntax i am using is:
Me.Filter = "([Program ID] = " & Me.Parent("ProgramID") & " and " & "[Sub Program ID] = " & Me.Parent("SubProgramID") & " and " & "[LocalProjectID] = " & Me.Parent("LocalProjectID" ) & " and " _
& "[Env] = '" & Me.Parent("Environment") & "' and " & "[Milestone Record Type] = " & Me.Parent("RecordType") & " and " & "[PhaseID] = " & Me.Parent("PhaseID") & " )"
Me.Filter = "([Program ID] = " & Me.Parent("ProgramID") & " and " & "[Sub Program ID] = " & Me.Parent("SubProgramID") & " and " & "[LocalProjectID] = " & Me.Parent("LocalProjectID"
& "[Env] = '" & Me.Parent("Environment") & "' and " & "[Milestone Record Type] = " & Me.Parent("RecordType") & " and " & "[PhaseID] = " & Me.Parent("PhaseID") & " )"
ASKER
the key to the subform is more than the 3 fields allowed in the link. I am building this key on the parent form via list boxes and then display the results from the detail form.
ASKER
if there was a way to allow for more than 3 linked fiedls that would be perfect
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
You gave me the hint i needed. I simply added the link fields manually and everything works great. Thanks
ummm, ...ok
;-)
Jeff
;-)
Jeff
The Load event of which form?
The main form or the subform?
The Subform will be filtered automatically for the corresponding "Main form" record when it opens so I can't easily see a need for doing this on the Subform's Load event...
So can you first take a step back and explain what you are trying to do and why?
Perhaps there is another alternative...