View Single Post
  #2  
Old March 24th, 2010, 11:05 AM posted to microsoft.public.access.forms
Douglas J. Steele[_3_]
external usenet poster
 
Posts: 3,143
Default Referencing a subform

Depending on how YoungPersonSubform was added as a subform, the name of the
subform control on frmNotice may be something different.

Also, where is Combo60: on frmNotice, or on YoungPersonSubform?

--
Doug Steele, Microsoft Access MVP
http://www.AccessMVP.com/DJSteele
(no e-mails, please!)

"Richard" wrote in message
...
Hi
I have a form "frmNotice"
& a subform "YoungPersonSubform"
with a combo box to update the record displayed in the subform
The two forms are linked on the field IDPerson

The challenge I have is Refreshing or Requerying the subform with the
error
2465
"can't find the field YoungPersonSubform"

the code for the combo box is:

Private Sub Combo60_AfterUpdate()
' Find the record that matches the control.
Forms!frmNotice.IDPerson = Combo60 'updating the mainform - works

Forms!frmNotice!YoungPersonSubform.Form.Requery '2465 error cant find
field..
Forms![YoungPersonSubform].Requery '2450 cant finnd the form
...
Forms!frmnotice![YoungPersonSubform].Requery '2465 cant find field ...
Forms!frmnotice.form![YoungPersonSubform].Requery '2465 cant find field
...
Forms!frmnotice.Form![YoungPersonSubform].Form.Requery '2465 " " "


I have also tried:
DoCmd.GoToRecord acDataForm, "youngpersonsubform", acGoTo, IDPerson =
Combo60
With error 2489 The object 'YoungPersonSubform' isn't open!

Office 2003 being used, I can see the subform open within a tab on the
parent form, so why am I having these problems?

I have listed just some of the variations I have tried to refresh the
subform, others have been tried with similar effect with & without
brackets
for the formname.

The subform will update if I move to another record & return to the
first!!

I have also tried the refresh line of code in the onCurrent event on the
mainForm with no results.

Would be most grateful for some assisatance - Thanks
--
Richard