Problem unlocking fields on subform

G

Guest

Before I get to the problem, here is the setup:

-- Parent form is frmMain. It has a frame in it called subFrame. frmMain
is based on qryFrmMain.

-- Subform is fsubStatEntry. It is currently based on a regular select
query qryStatistics, but could also be based directly to tblStatistics (they
have the same fields).

In the past, when we have set up linked forms, we have done it in this manner:

stLinkCriteria = "[EMPNUM]=" & "'" & Forms!frmAssoc!EmpNum & "'"
DoCmd.OpenForm stDocName, acViewNormal, , stLinkCriteria

I could not figure out how to change that structure to work with a subform,
and I couldn’t get my subform to filter based on the txtAssocID field that
was on both frmMain and fsubStatEntry. I had the Master and Child links set
up (in properties & in code), tried setting in a filter (in properties & code
again), etc, but it would always display all records from tblStatistics, not
just those for the ID showing on frmMain.

Since I couldn’t figure the filter or link criteria out, I just made a
select query for the subform (called qryStatistics) so that it would filter
for the ID showing on the main form. This appeared to work fine until I
tried to enter data into the text boxes in the subform. If fsubStatEntry is
opened by itself (manually) the fields will accept data. But when the form
is opened in the frame on frmMain, no entry is possible. When I switched the
source of fsubStatEntry back to tblStatistics (instead of the query) you can
enter data even when in the frame.

I need help either to set up the filter and/or link criteria so the subform
can be based on the table, or I need to figure out how to make data entry
possible when the subform is based on the query.
 

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