Referring to Subform

J

JamesJ

I'm trying to filter a subform to display the same records as the main
form but I'm not having much luck, apparently referring to the subform.
Not sure how to Link Master and Child fields. I'm using another table
to display 2 values in a cbo which the selection of filters the records.
The records get filtered in the main form but not in the subform.
Both are based on the same table. The lookup field is ReminderTypeID and
the Primary key is ReminderID

Any help will be appreciated,
James
 
R

Rod Plastow

James,

Main/Sub form construct is conventionally used to display one-to-many or
one-to-one relationships. OK, your main form may have a bound recordset with
many rows but normally you display these one at a time on a single form. The
link fields tell Access which values to use in synchronising the subform, the
LinkMaster field being the one on the main form and the LinkChild field being
the one on the subform. Properly specified Access will do all the hard work
in synchronising the sub form as you step forwards and backwards through your
main form recordset, filtered or not.

There are exceptions to the foregoing, particularly where the main form may
be a list and the subform displays further details about the highlighted row.
Even here Access will synchronise as you move up and down or refilter the
list.

However from your description it sounds as though you are using two
continuous forms (?), based on the same table (?) and expect a filter applied
to the one to affect the other.

If you really need to do this forget about using the link fields; it simply
won't work. You need to address and alter the properties of the subform to
match the properties of the main form and then (possibly) issue a requery
command for the subform.

To address the subform from within your main form use something like the
following.

Me![MySubFormControl].Form.<property>
Me![MySubFormControl].Form![MyControl]

The first accesses the subform property and the second accesses the
subform's controls.

Rod
 
J

JamesJ

Actually, it's more like the Split Form using Access 2007. I want
Conditional Formatting which I don't believe you van accomplish
in the Datasheet of a Split Form.

James

Rod Plastow said:
James,

Main/Sub form construct is conventionally used to display one-to-many or
one-to-one relationships. OK, your main form may have a bound recordset
with
many rows but normally you display these one at a time on a single form.
The
link fields tell Access which values to use in synchronising the subform,
the
LinkMaster field being the one on the main form and the LinkChild field
being
the one on the subform. Properly specified Access will do all the hard
work
in synchronising the sub form as you step forwards and backwards through
your
main form recordset, filtered or not.

There are exceptions to the foregoing, particularly where the main form
may
be a list and the subform displays further details about the highlighted
row.
Even here Access will synchronise as you move up and down or refilter the
list.

However from your description it sounds as though you are using two
continuous forms (?), based on the same table (?) and expect a filter
applied
to the one to affect the other.

If you really need to do this forget about using the link fields; it
simply
won't work. You need to address and alter the properties of the subform
to
match the properties of the main form and then (possibly) issue a requery
command for the subform.

To address the subform from within your main form use something like the
following.

Me![MySubFormControl].Form.<property>
Me![MySubFormControl].Form![MyControl]

The first accesses the subform property and the second accesses the
subform's controls.

Rod

JamesJ said:
I'm trying to filter a subform to display the same records as the main
form but I'm not having much luck, apparently referring to the subform.
Not sure how to Link Master and Child fields. I'm using another table
to display 2 values in a cbo which the selection of filters the records.
The records get filtered in the main form but not in the subform.
Both are based on the same table. The lookup field is ReminderTypeID and
the Primary key is ReminderID

Any help will be appreciated,
James
 
J

JamesJ

I'm using the following so the main form and the sub form have the same
recordsource in the On Load of the main form:
:
Me![frmDvdSub].Form.RecordSource = Me.RecordSource
But the Sub form display only the first row... no other records.

James

Rod Plastow said:
James,

Main/Sub form construct is conventionally used to display one-to-many or
one-to-one relationships. OK, your main form may have a bound recordset
with
many rows but normally you display these one at a time on a single form.
The
link fields tell Access which values to use in synchronising the subform,
the
LinkMaster field being the one on the main form and the LinkChild field
being
the one on the subform. Properly specified Access will do all the hard
work
in synchronising the sub form as you step forwards and backwards through
your
main form recordset, filtered or not.

There are exceptions to the foregoing, particularly where the main form
may
be a list and the subform displays further details about the highlighted
row.
Even here Access will synchronise as you move up and down or refilter the
list.

However from your description it sounds as though you are using two
continuous forms (?), based on the same table (?) and expect a filter
applied
to the one to affect the other.

If you really need to do this forget about using the link fields; it
simply
won't work. You need to address and alter the properties of the subform
to
match the properties of the main form and then (possibly) issue a requery
command for the subform.

To address the subform from within your main form use something like the
following.

Me![MySubFormControl].Form.<property>
Me![MySubFormControl].Form![MyControl]

The first accesses the subform property and the second accesses the
subform's controls.

Rod

JamesJ said:
I'm trying to filter a subform to display the same records as the main
form but I'm not having much luck, apparently referring to the subform.
Not sure how to Link Master and Child fields. I'm using another table
to display 2 values in a cbo which the selection of filters the records.
The records get filtered in the main form but not in the subform.
Both are based on the same table. The lookup field is ReminderTypeID and
the Primary key is ReminderID

Any help will be appreciated,
James
 
R

Rod Plastow

Hi Again,

I've just tried to include a continuous subform on a continuous main form
and been promptly given my marching orders by Access. I've never tried that
before. The lists I referred to in my previous post have always been
implemented via a combo or list box.

So you want to simulate the A2007 Split Form but don't want to use that
particular facility because it doesn't allow conditional formatting? But it
does. Specify your conditional formatting control by control in design view
and that formatting will be reflected in both the upper and lower panes of
the split form.

However this somewhat avoids the reason for your original post. I'll try
and get back to you on that soon. It's now midnight here and I'm tired.

Rod
 

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