Reference a control on Main form

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

Guest

Hi experts!

I have a subform, Sfrm_Current_Qtr_Data, with a checkbox control "Archive"
that when the Box is checked several things happen one of which is I want to
put the cursor back onto the main form, Frm_Tap_Accounts.

My question is how do I reference the Frm_Tap_Accounts from
Sfrm_Current_Qtr_Data. Currently, I get and error message saying there is no
control name on the main form "5264", where "5264" is the account number on
the main form. Do I need some quotation marks somewhere. Because even when
I surround the Main form control, " Frm_Tap_Accounts.Account_No" I get the
error "There is no field named 'Forms!frm_Tap_Accounts.Account_No' in the
current record."

Here s my code:

Private Sub Archive_AfterUpdate()

DoCmd.GoToControl Forms!Frm_Tap_Accounts.Account_No

DoCmd.RunCommand acCmdSaveRecord

Forms!Frm_Tap_Accounts!Sfrm_Current_Qtr_Data.Requery

Forms!Frm_Tap_Accounts!Sfrm_Qry_Archive2.Requery

End Sub
 
My question is how do I reference the Frm_Tap_Accounts from
Sfrm_Current_Qtr_Data.

Two lines:

Parent.SetFocus ' set the focus to the parent form
Parent.SomeCOntrolName.SetFocus ' then to an appropriate control


John W. Vinson[MVP]
 
Thank you, John

Emma

John Vinson said:
Two lines:

Parent.SetFocus ' set the focus to the parent form
Parent.SomeCOntrolName.SetFocus ' then to an appropriate control


John W. Vinson[MVP]
 
Back
Top