Refresh multiple layered subform on update of checkbox

I have a multi-layered subform.  If the user Click the inactive field = true.  then I need to refresh current subform and also the subform containing the inactive list of records (another subform on the Master Subform).  since both subforms are using the same query expect where Inactive = false or true.

I have tried the following however, running into an error.  i verified the form names and even used the Expresssion builder to set the sourceobject values.

Private Sub Active_AfterUpdate()
If Me.Active = True Then
   ' Forms![frmNotesMain]![FrmNotes_MasterMain].Form![frmNotes_Master_Sub].Requery
    Forms![frmNotesMain]![FrmNotes_MasterMain].Form![frmNotes_MasterInActiveOnly_Sub].SourceObject _
        = Forms![frmNotesMain]![FrmNotes_MasterMain].Form![frmNotes_MasterInActiveOnly_Sub]
End If
End Sub

Open in new window


what am I missing.  Getting type mismatch issue - boy do I have this error message it never means what it really stands for.

Thanks,

K
Karen SchaeferBI ANALYSTAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Gustav BrockCIOCommented:
If from the main form, it would be:

    Me!NameOfOtherSubformControl.Form.Requery

If from a subform of the main form, it would be:

    Me.Parent!NameOfOtherSubformControl.Form.Requery

/gustav

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Dale FyeOwner, Developing Solutions LLCCommented:
When you talk about nested subforms, you should really diagram it out for us, something like:
MainForm
- SubForm1
   -  SubForm1Subform
- Subform2

and then make it clear where the controls are that you are updating.

Assuming that the Inactive field on the main form will affect which of the subforms that record is displayed in, then the first step is to save that record.  

Secondly, you will actually need to requery both of the subforms, not just one.

Private Sub Active_AfterUpdate()

    me.Dirty = false   'saves the current record
    me.[FrmNotes_MasterMain].Form![frmNotes_Master_Sub].Requery
    me.[FrmNotes_MasterMain].Form![frmNotes_MasterInActiveOnly_Sub].Requery

End Sub
Karen SchaeferBI ANALYSTAuthor Commented:
Thanks for the input, however, this project was cancelled I no longer need assistance with this issue.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.