Subform requery

H

Harley Feldman

I have a main form called "Studies" with two subforms "PatientStudies" and "PatientPhases" PatientStudies is linked in Master/Child relationship by StudyID and works fine. PatientPhases could be a subform of PatientStudies linked by PatientKey. However, when I put PatientPhases as a subform of PatientStudies, I cannot add new records to the PatientPhases table upon which the PatientPhases Subform is based - the new record indicator is grayed out.

I have also tried to place both subforms on the Studies form and link them through the PatientKey text box on the PatientStudies form. I set up a query to find the data items from PatientPhases with a criteria of Forms!Studies![PatientPhases Subform]![PatientKey]. I think that all I need now is to force a Requery of the PatientPhases form under the Current or AfterUpdate event on the PatientStudies form.

Do anyone know either what I am doing wrong in the first approach or can tell me how to force a requery for the PatientPhases subform from the PatientStudies form?

Thanks,

Harley
 
N

NetworkTrade

My advice on the subform-new record issue is somewhat evasive - in that I do
not like subforms because they become limited in space so quickly. I would
tend to put a button on the first form "PatientStudies" that opens the
PatientPhase form - using the key link so it is the same patient info that
opens up. So it is a separate form and not a subform

But if you have to stick with the subform set up - be sure to double check
and compare your properties of these forms that they allow edits &
additions...

As to a requery; with an event - such as a button click - you can use the
Macro module to set it up so it closes the form/query and then reopens the
query/form - which is a requery in the end....

not quite sure I fully understand your situation and this is a little off
the cuff....
 

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

Similar Threads

Subform Requery Criteria 1
Requery listbox 1
Requery unbound textbox 1
Requery subform 2
Requery subforms 2
Link subform ID control 3
Refreshing a subform 3
Requery subform doesn't display all records 1

Top