Requery correct? Please advise...

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I have some nested subforms that contain information...I also have an add
doctor button. The goal is to have the form requeried on the fly...but it
doesn't seem to be updating all the time. (?!) Here's the code on the OnClose
ppty of the add doctor form:

Forms!frmGHclients!frmdoctorvisit.SetFocus
Forms!frmGHclients!frmdoctorvisit![frmdrugtreatmentplan].Form.Requery

When I press F9, it updates. Shouldn't the code above do the same thing?

Thanks in advance,

Rookie.

Ps - frmdoctorvisit is a subform in frmGHClients; frmdrugtreatmentplan is a
form in frmdoctorvisit.
 
You may need to use:

Forms!frmGHclients!frmdoctorvisit.Form![frmdrugtreatmentplan].Form.Requery

Beware that this works only if "frmdoctorvisit" and "frmdrugtreatmentplan"
are the name of the SubFormCONTROLs. The names of the SubFormControls may
be different from the names of the Forms being used as the Subforms (more
technically accurate, being used as the SourceObjects of the
SubformControls).
 
Hey Van,

Thanks for your post...it worked. I should have been requerying a particular
control on the form to update the ppty.

Many many thanks!

John.

Van T. Dinh said:
You may need to use:

Forms!frmGHclients!frmdoctorvisit.Form![frmdrugtreatmentplan].Form.Requery

Beware that this works only if "frmdoctorvisit" and "frmdrugtreatmentplan"
are the name of the SubFormCONTROLs. The names of the SubFormControls may
be different from the names of the Forms being used as the Subforms (more
technically accurate, being used as the SourceObjects of the
SubformControls).

--
HTH
Van T. Dinh
MVP (Access)


Access rookie said:
Hello,

I have some nested subforms that contain information...I also have an add
doctor button. The goal is to have the form requeried on the fly...but it
doesn't seem to be updating all the time. (?!) Here's the code on the OnClose
ppty of the add doctor form:

Forms!frmGHclients!frmdoctorvisit.SetFocus
Forms!frmGHclients!frmdoctorvisit![frmdrugtreatmentplan].Form.Requery

When I press F9, it updates. Shouldn't the code above do the same thing?

Thanks in advance,

Rookie.

Ps - frmdoctorvisit is a subform in frmGHClients; frmdrugtreatmentplan is a
form in frmdoctorvisit.
 
Back
Top