473,748 Members | 5,230 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Cannot update Label Caption on Subform from inside another subform?

I've got a little bit of code that runs when you enter data in a
datasheet view (which is a subform of the form you are in)

if rst!DateReceive d >= 30 Then
Forms!DisposalR ecords.Label90. Caption = (Date - rst!DateReceive d) &
" Days"
however, when that runs to update the caption, it says that it cannot
find form DisposalRecords

I've also tried.

Me.Parent.Dispo salRecords.Labe l90.Caption

I've tried
[Forms_Disposal].DisposalRecord s.Label90.Capti on (Where Disposal is
the parent form of DisposalRecords ).

I've even tried [Forms]![DisposalRecords]![Label90].Caption ..

They all give me the same thing, or similar. Cannot find Form
"DisposalRecord s"...

However, anything that's in the parent form (to the second subform)
can update it.. but if it's in the first Child (First Subform).. trying
to update the Second Subform of the parent, it bails out on me.

I hope this makes sense. I'm new to working with Access.. and more
specifically we are using Access 97.

Nov 22 '06 #1
4 5043
See if this link help.
Refer to Form and Subform properties and controls
http://www.mvps.org/access/forms/frm0031.htm

Ryan wrote:
>I've got a little bit of code that runs when you enter data in a
datasheet view (which is a subform of the form you are in)

if rst!DateReceive d >= 30 Then
Forms!DisposalR ecords.Label90. Caption = (Date - rst!DateReceive d) &
" Days"

however, when that runs to update the caption, it says that it cannot
find form DisposalRecords

I've also tried.

Me.Parent.Dispo salRecords.Labe l90.Caption

I've tried
[Forms_Disposal].DisposalRecord s.Label90.Capti on (Where Disposal is
the parent form of DisposalRecords ).

I've even tried [Forms]![DisposalRecords]![Label90].Caption ..

They all give me the same thing, or similar. Cannot find Form
"DisposalRecor ds"...

However, anything that's in the parent form (to the second subform)
can update it.. but if it's in the first Child (First Subform).. trying
to update the Second Subform of the parent, it bails out on me.

I hope this makes sense. I'm new to working with Access.. and more
specifically we are using Access 97.
--
HTH - RuralGuy (RG for short) acXP WinXP Pro
Please post back to this forum so all may benefit.

Message posted via AccessMonster.c om
http://www.accessmonster.com/Uwe/For...ccess/200611/1

Nov 23 '06 #2
Thanks..

But I dont see one that fits what I'm doing unless I'm mistaken.

Main Form
| |
Sub1 Sub2

I want Sub1 to update something on the main form that ultimately is
from Sub2. It's just a label caption.

Not sure if that little 'ascii' diagram will come through once
formatting gets ahold of this thread.
ruralguy via AccessMonster.c om wrote:
See if this link help.
Refer to Form and Subform properties and controls
http://www.mvps.org/access/forms/frm0031.htm

Ryan wrote:
I've got a little bit of code that runs when you enter data in a
datasheet view (which is a subform of the form you are in)

if rst!DateReceive d >= 30 Then
Forms!DisposalR ecords.Label90. Caption = (Date - rst!DateReceive d) &
" Days"

however, when that runs to update the caption, it says that it cannot
find form DisposalRecords

I've also tried.

Me.Parent.Dispo salRecords.Labe l90.Caption

I've tried
[Forms_Disposal].DisposalRecord s.Label90.Capti on (Where Disposal is
the parent form of DisposalRecords ).

I've even tried [Forms]![DisposalRecords]![Label90].Caption ..

They all give me the same thing, or similar. Cannot find Form
"DisposalRecord s"...

However, anything that's in the parent form (to the second subform)
can update it.. but if it's in the first Child (First Subform).. trying
to update the Second Subform of the parent, it bails out on me.

I hope this makes sense. I'm new to working with Access.. and more
specifically we are using Access 97.

--
HTH - RuralGuy (RG for short) acXP WinXP Pro
Please post back to this forum so all may benefit.

Message posted via AccessMonster.c om
http://www.accessmonster.com/Uwe/For...ccess/200611/1
Nov 27 '06 #3
A SubForm can reference the MainForm in two way: through the Forms collection
or directly using Me.Parent.

Forms!MainFormN ame!ControlName

or

Me.Parent.Contr olName

...using your form and control names of course.

Ryan wrote:
>Thanks..

But I dont see one that fits what I'm doing unless I'm mistaken.

Main Form
| |
Sub1 Sub2

I want Sub1 to update something on the main form that ultimately is
from Sub2. It's just a label caption.

Not sure if that little 'ascii' diagram will come through once
formatting gets ahold of this thread.
>See if this link help.
Refer to Form and Subform properties and controls
[quoted text clipped - 36 lines]
>Message posted via AccessMonster.c om
http://www.accessmonster.com/Uwe/For...ccess/200611/1
--
HTH - RuralGuy (RG for short) acXP WinXP Pro
Please post back to this forum so all may benefit.

Message posted via http://www.accessmonster.com

Nov 27 '06 #4

Ryan wrote:
I've got a little bit of code that runs when you enter data in a
datasheet view (which is a subform of the form you are in)

if rst!DateReceive d >= 30 Then
Forms!DisposalR ecords.Label90. Caption = (Date - rst!DateReceive d) &
" Days"
however, when that runs to update the caption, it says that it cannot
find form DisposalRecords

I've also tried.

Me.Parent.Dispo salRecords.Labe l90.Caption

I've tried
[Forms_Disposal].DisposalRecord s.Label90.Capti on (Where Disposal is
the parent form of DisposalRecords ).

I've even tried [Forms]![DisposalRecords]![Label90].Caption ..

They all give me the same thing, or similar. Cannot find Form
"DisposalRecord s"...

However, anything that's in the parent form (to the second subform)
can update it.. but if it's in the first Child (First Subform).. trying
to update the Second Subform of the parent, it bails out on me.

I hope this makes sense. I'm new to working with Access.. and more
specifically we are using Access 97.
You should be able to use either of the the following from the first
child subform:

[Forms_Disposal].DisposalRecord s.Form!Label90. Caption
Me.Parent.Dispo salRecords.Form !Label90.Captio n

In either case note that you must reference the Form property of the
subform object (DisposalRecord s) to get to the underlying controls in
your subforms. I always make it a habit to rename my subforms
fsubFormName to remind me that they are subform controls, not actual
form objects embedded in another form.

HTH,
Bruce

Nov 27 '06 #5

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

Similar topics

3
11448
by: Pavan Arise | last post by:
Hi all.. This may seem simple..but I am stuck here! I have a frame in which I have a label. I was trying to change the caption of that label via code (I mean at runtime & not design time). But there is always an error saying "Compile error: Method or data member not found" I have no idea how to solve thsi problem. I have created my label on the frame itself. I tried to do it witha text box instead of a label...but in vain...the same error...
3
4145
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 of the tabs has a subform showing order data (in datasheet view). On the same tab there is an unbound textbox (next to the datasheet). I placed a
1
11526
by: Darn | last post by:
Hi all How do i solve this problem. I'm web developer from Malaysia, the problem occurs when i ftp an Access database which i'm using for this particular web site for it's database.The form which i used to update data inside that database has create some problem like Error Type: Microsoft OLE DB Provider for ODBC Drivers (0x80004005) Cannot update. Database or object is read-only.
2
14894
by: webbi | last post by:
I have a text box called txtAttirubte1 and an update button in FormA. I want to update the label caption for all label name Attribute1_Lable in FormB and FormC with the WORD I type in the FormA text box, txtAttribute1. I have the following codes for the ON CLICK event of Update button on FormA. Private Sub cmdUpdate_Click() DoCmd.OpenForm "frm_FormB" !!.Caption = Me!.Value DoCmd.Close acForm, frm_FormB, acSavePrompt ...
4
2525
by: MrDeej | last post by:
Hello guys! I have a masterform "kg" and a subform "kg varelinjer" (order and order details in english) In the subform i have a field named "lagerbeholdning" (storage quantity) and my problem is that i need to make a button for users which updates this field with data from another tabel on demand. I have tried to make some code myself Do While Not .NewRecord .Lagbeholdning.SetFocus .Lagbeholdning = DLookup("lagerbeholdning", "tbl...
1
2825
by: zion | last post by:
Hello, How can I change label caption on page load ? Thanks
4
5098
by: Annie Bender | last post by:
Wow, I finally got through my first VB "tutorial" project and everything works nice, except one userform label caption will only display as long as the Excel column it draws data from is set wide enough to show the data on the spreadsheet too. But that data is not supposed to be visible to spreadsheet users, as it involves intermediate calculations only. I don't see anything special about either that particular data (it's numeric) or about the...
1
7659
by: jonkillua | last post by:
hi guys, i'm creating a program that instead of using the print method to display the odd/even numbers, i want to display the result in label.caption. Im crazy about it, please help me. Private Sub cmdEven_Click() Dim x As Integer Dim intReturn As Integer If txtNum = "" Then intReturn = MsgBox("enter a number!", vbExclamation + vbOKOnly) End If
1
2111
by: BranX | last post by:
I have a label on a worksheet. When I press a button on the same worksheet, the program should set the new label caption and do some other calculations. The problem is, that new label caption is visible after the program finishes. I have put application.screenupdating= false after setting new label caption, so this is not the problem. Can anyone please help me.
0
8991
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8830
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9544
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9324
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9247
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
4606
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3313
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2783
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2215
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.