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

How to refer to the control on the second subform

P: n/a
MP
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
message:
Can't find the field »POG-03 Work Subform« reffrred to in your
expression.

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_Com_Work_Click:
Exit Sub

Err_Com_Work_Click:
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.
Mojca

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


P: n/a
Try this.

Me!Subform1.Form!Subform2.Form.RecordSource

Nov 15 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.