473,407 Members | 2,598 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,407 software developers and data experts.

Setting a value in a subform

I have a form that has a subform that has a subform.

The subform loads a record based on a combo lookup box in the main form.
I'm trying to set a value in the subform based on a value in a subform of
the subform.

the main Form is called [Clock Out]
Subform is called [Clock Out Subform]
Subform in the subform is called [Pay IOU Subform]

The proceedure i am running is from the On Dirty event proceedure in the
[Pay IOU Subform] .

I am trying to set a value for the text box named [txtIOUAmountPaid] in the
[Clock Out Subform]

I can copy the [txtIOUAmountPaid] text box to the [Clock Out] main form and
set the value there using:

Forms("Clock Out")("txtIOUAmountPaid").Value = 64 'Note:Using 64
to test it.

in the on dirty event proceedure which runs when there is a change in the
[Pay IOU Subform].

however, I am unable to set the value if the control is in the [Clock Out
Subform].
For some reason I can't find the [Clock Out Subform]
I've typed this in the immediate window to see if the forms exist.
? CurrentProject.AllForms("Clock Out Subform").IsLoaded
False.
? CurrentProject.AllForms("Clock Out").IsLoaded
True
? CurrentProject.AllForms("Pay IOU Subform").IsLoaded
False
I am assuming that I can't set the value becuase the subforms don't appear
to be loaded. But they should be. I can set other values in the subform if
I type them in and they are saved with the record. Why are the subforms not
showing up with the isloaded call.
How can I set a control in a subform. I have tried 30 or so different
combinations with dots & exclamation points with no luck.

Any help appreciated
thanks
john michael

Nov 13 '05 #1
1 8399
When a form is a subform, it is not part of the Forms collection, so you
can't reference it that way. You'll need to use the syntax:

Forms!Main_Form_Name!Subform_Control_Name.Form!Con trolName
(there is a shortened version of this, but this is less prone to
misunderstanding IMHO).

So if your Clock Out Subform is in a control called sfClockOut, you would
use:
Forms![Clock Out]!sfClockOut.Form!txtIOUAmountPaid
or
Forms("Clock Out")("sfClockOut").Form("txtIOUAmountPaid")

short form:
Forms("Clock Out")("sfClockOut")("txtIOUAmountPaid")

--
Shane Suebsahakarn
----
Head of IT
PAN Telecom
Tel: +44 (0) 870 757 7001

"John Michael" <jo***@acadiacom.net> wrote in message
news:10*************@corp.supernews.com...
I have a form that has a subform that has a subform.

The subform loads a record based on a combo lookup box in the main form.
I'm trying to set a value in the subform based on a value in a subform of
the subform.

the main Form is called [Clock Out]
Subform is called [Clock Out Subform]
Subform in the subform is called [Pay IOU Subform]

The proceedure i am running is from the On Dirty event proceedure in the
[Pay IOU Subform] .

I am trying to set a value for the text box named [txtIOUAmountPaid] in the [Clock Out Subform]

I can copy the [txtIOUAmountPaid] text box to the [Clock Out] main form and set the value there using:

Forms("Clock Out")("txtIOUAmountPaid").Value = 64 'Note:Using 64 to test it.

in the on dirty event proceedure which runs when there is a change in the
[Pay IOU Subform].

however, I am unable to set the value if the control is in the [Clock Out
Subform].
For some reason I can't find the [Clock Out Subform]
I've typed this in the immediate window to see if the forms exist.
? CurrentProject.AllForms("Clock Out Subform").IsLoaded
False.
? CurrentProject.AllForms("Clock Out").IsLoaded
True
? CurrentProject.AllForms("Pay IOU Subform").IsLoaded
False
I am assuming that I can't set the value becuase the subforms don't appear
to be loaded. But they should be. I can set other values in the subform if I type them in and they are saved with the record. Why are the subforms not showing up with the isloaded call.
How can I set a control in a subform. I have tried 30 or so different
combinations with dots & exclamation points with no luck.

Any help appreciated
thanks
john michael



Nov 13 '05 #2

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

Similar topics

3
by: JKop | last post by:
Consider the following platform: char = 8-bit short = 16-bit int = 32-bit long = 32-bit
5
by: Ellen Manning | last post by:
Using A2K. I need the syntax to set the recordsource for a subform within a subform. The "main" subform's recordsource changes based on user input. I need to change the recordsource on the...
0
by: CSDunn | last post by:
Hello, I have a subform where the 'Name' and 'Source Object' properties are both 'frmSelectByTestSUB'. This subform resides in a main form called 'frmSelectByTest'. In the subform, I have a...
0
by: CSDunn | last post by:
Hello, I have a subform where the 'Name' and 'Source Object' properties are both 'frmSelectByTestSUB'. This subform resides in a main form called 'frmSelectByTest'. In the subform, I have a...
4
by: elfyn | last post by:
I'm currently developing a Fleet system which enables the user to enter Parts used to Service a vehicle. The parts are available through a Combo Box on a form and if the user enters a new Part the...
1
by: George | last post by:
I am trying to set the value of items in a dropdown list dynamically, and can't seem to figure out how to do it. I have two arrays set up like this: Dim a() as string ={"A", "B", "C"} Dim b()...
6
by: Rick | last post by:
I have a main form called frmDemo with a subform frmStageTrack_Sub. On the subform is a Combo Box CboTermID. The frmDemo is tied to tblDemo and the frmStageTrack_Sub is tied to tblStageTrack. ...
0
by: John | last post by:
Hi, I have set a DataGridViewComboBoxColumn for a complex object type, and set the DisplayMember and ValueMember to members of the object type. My problem is how to programmatically set the cell...
11
by: arggg | last post by:
I have a statusbar and created a textbox to double test this however the value is being sent as I did a MessageBox.Show(value); and it shows the value being passed yet it is not being set. Can...
2
by: mbalas2 | last post by:
I set the value of Total texbox through javascript, and Total texbox does show the changed value. But when i access the textbox while saving in the db, the value is reset to previous value (value...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: 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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.