Form Filter Based on a Value in a Subform

G

Guest

Good day,

I have: A continuous subform; each record has a unique field, some locked
fields, some unlocked fields, and a "Details" button.

I want: When the user clicks the "Details" button, a form opens. The form
will only display records based on the unique field.

Any suggestions?
 
S

Steve Schapel

DevDaniel,

There are several ways to approach this.

One is to use the Where Condition argument of the OpenForm method to
specify the record for the Details for to open at. For example...
DoCmd.OpenForm "Details", , , "[UniqueField]=" & Me.UniqueField

Another is to use a query for the Record Source of the Details form, and
in the Criteria of the UniqueField column, enter a reference to the
form's control, possibly something like this...
[Forms]![NameOfForm]![NameOfSubform]![UniqueField]
 
G

Guest

It worked! Thanks for the help, Steve!

Steve Schapel said:
DevDaniel,

There are several ways to approach this.

One is to use the Where Condition argument of the OpenForm method to
specify the record for the Details for to open at. For example...
DoCmd.OpenForm "Details", , , "[UniqueField]=" & Me.UniqueField

Another is to use a query for the Record Source of the Details form, and
in the Criteria of the UniqueField column, enter a reference to the
form's control, possibly something like this...
[Forms]![NameOfForm]![NameOfSubform]![UniqueField]

--
Steve Schapel, Microsoft Access MVP

Good day,

I have: A continuous subform; each record has a unique field, some locked
fields, some unlocked fields, and a "Details" button.

I want: When the user clicks the "Details" button, a form opens. The form
will only display records based on the unique field.

Any suggestions?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top