OpenForm Filter

Novice1

Registered User.
Local time
Today, 07:57
Joined
Mar 9, 2004
Messages
385
I have two forms both with a field [Group].

I'm in a record in frmAuditSchedule. I want to open [frmInputScreen] filtered on [Group] of the record I'm working on in frmAuditSchedule.

I tried ...

DoCmd.OpenForm "frmInputScreen", acNormal, , Forms![frmAuditSchedule]![Group]

but the form opens filtered but showing all records (not filtered on [Group]).

Any help would be appreciated.
 
The filter criteria needs to be an evaluation (=, >, <, etc.). Generally the left side of the evaluation is the field name of a table that the form is based on. The right side is what you want to use to evaluate that field to.

So your filter string:

Code:
 Forms![frmAuditSchedule]![Group]

Uses no evaluation method (=, >, <, etc.) so it never really fires off. To achieve what you want, let's assume frmInputScreen is based on a table with a field called [GroupName]. Your criteria string would then be this:

Code:
"[GroupName]='" & Forms![frmAuditSchedule]![Group] & "'"
 

Users who are viewing this thread

Back
Top Bottom