473,386 Members | 1,674 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

How to refer to the control on the second subform

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
1 3018
Try this.

Me!Subform1.Form!Subform2.Form.RecordSource

Nov 15 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: solar | last post by:
How to refer to a subform ? On my main form called FrmEmployees I have a button to open a report. I want to forbid opening the report in case the liters in the subform are 0. To this end I...
12
by: MLH | last post by:
I have created two forms: frmBrowseNegsMainform and frmBrowseNegsSubform. I put a subform control on the first of these. The SourceObject property for the subform control is, of course,...
3
by: Joshua Ammann | last post by:
Hi, (Using Access 2000) I have two tables, similar to Customers and Orders. (Not an exact parallel, but works for this example.) On a form showing customer data, there is a tab control. One...
7
by: kevin.jonas | last post by:
Let say I have a form called "frmMachineSpecs" witht wo subforms, "frmSpecs" and "frmMachines". Both subforms are in datasheet view. The first control in "frmSpecs" is "txtOEM_No". I want to...
2
by: James | last post by:
Hi I have set up a subform in datasheet mode containing a second subform also in datasheet mode in order to be able to open it as a subdatasheet. In my application I make the first subform...
2
by: dBNovice | last post by:
Hello All, I could really use some serious help with this one... I have a form that has a tab control with 3 pages. Page(0) is Tasks, Page(1) is SubTasks, and Page(2) is Elements. Page (1) is a...
3
by: ApexData | last post by:
I'm starting a new project. A Personnel System. I have considered opening a single bound form to the main employee table. The user can scroll the records to any individual. I would like to have a...
5
by: mtgrizzly52 | last post by:
First thing, because of you all and this web site, I am building a first class time saving database for my fellow workers to use. My really dumb questions is this. I have a control in a subform...
5
by: ChipR | last post by:
Question: Can I set a form's variable from another form? Details of my problem: In my Form1, I have Option Compare Database Option Explicit 'whether each tab has been updated, so they...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.