By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,196 Members | 1,784 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,196 IT Pros & Developers. It's quick & easy.

How to refer to the control on the second subform

P: n/a
I have a main form that has a subform which also has a subform:
the main form is [POG-01 Employees]
the first subform is [POG-02 Contracts Subform]
the second subform is [POG-03 Work Subform]

When I click on the button »AddNewSubSubRecord« (add a new record in
the second subform [POG-03 Work subform], the code generates the
Can't find the field »POG-03 Work Subform« reffrred to in your

My Code is:
Private Sub Com_Work_Click()
On Error GoTo Err_Com_Work_Click

' set focus to control holding the subform
Forms! [POG-01 Employees]![ POG-02 Contracts Subform].SetFocus
' set focus to control on the subform holding the subsubform
Forms![ POG-01 Employees]![ POG-02 Contracts Subform].Form![
POG-03 Work Subform].SetFocus

' go to new record
DoCmd.GoToRecord , , acNewRec

Exit Sub

MsgBox Err.Description
Resume Exit_Com_Work_Click

End Sub
The properties of my second subform are:
Name: [POG-03 Work Subform]
Source Object: [POG-03 Work Subform]
Link Child Field: [POG_ID]
Link Master Field: [POG-02 Contracts Subform].Form![POG_ID]
How to refer to the control on the second subform [POG-03 Work
Subform], when I click on the button »AddNewSubSubRecord«?
Thanks for any help or suggestions.

Nov 15 '05 #1
Share this Question
Share on Google+
1 Reply

P: n/a
Try this.


Nov 15 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.