OpenForm Criteria

G

Gus Chuch

Hello
I’m using a form with a cmd OpenForm button on it. It opens another form
with a criteria
DoCmd.OpenForm stDocName, , , stLinkCriteria
which work fine but once the form open I would like the criteria link to be
broken to the form so I move to other records with out have to close the
original form.
Why wouldn’t this brake the link?
stLinkCriteria = “â€
DoCmd.OpenForm stDocName, , , stLinkCriteria
Any help would be appreciated
 
A

Allen Browne

When you OpenForm with a WhereCondition, Access sets the Filter property of
the form. You can then turn the filter off with:
Forms(stDocName).FilterOn = False
or if you are in the target form:
Me.FilterOn = False

If you want to open the target form without a filter but with a particular
record displayed, you can OpenForm and then FindFirst in its RecordsetClone.
 
G

Gus Chuch

The me.filterOn=False work fine,
But, Yes I would like to open the form to display a particular record. In my
form I have a subform which is nothing more then a SQL in the Record source
but I would like to be able to highlighted one of those fields in the subform
and use that in my RecordSetClone .
How would I read which record I got highlighted on my subform?
 
A

Allen Browne

You can determine which record is the current row in your subform from the
value of its primary key.
 
G

Gus Chuch

How?
How do I get this value from the SubForm? Is it some kind of ListIndex
I’m sorry but I’m lost!
 
A

Allen Browne

You want to find a record in the *subform* of the target form?

If the target form has a subform, how is it connected to its main form? Do
you first need to find the record in the main form that has the desired
record in the subform, and then find the record in the subform?
 

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