A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Changing BackColor Property of Main Form Label from SubForm



 
 
Thread Tools Display Modes
  #11  
Old April 21st, 2008, 08:36 PM posted to microsoft.public.access.forms
Tennessee Teabagger
external usenet poster
 
Posts: 1
Default Changing BackColor Property of Main Form Label from SubForm

On Apr 2, 4:19*pm, Access User
wrote:
I tried this w/o oberving any changes:

Private Sub Aneurism_AfterUpdate()

*IfMe.Aneurism 4Then
* * Me.Parent!Label113.BackColor = vbRed
* * Else
* * Me.Parent!Label113.BackColor = vbWhite
*EndIf

End Sub



"Maurice" wrote:
try this:


* * * * Me.Parent!Label113.BackColor = vbRed


themainformcan be refered to as parent...


hth
--
Maurice Ausum


"Access User" wrote:


Well, I guess we tried but still no cigar...I changed my VBA to conform


Private Sub Aneurism_AfterUpdate()


*IfMe.Aneurism 4Then
* * Forms![MRA Form_JPS]!Label113.BackColor = vbRed
* * Else
* * Forms![MRA Form_JPS]!Label113.BackColor = vbWhite
*EndIf


End Sub


but nothing seemingly has been affected.


???
"M Skabialka" wrote:


Try changing 'Me' to 'Forms' as you are on asubformand thatsubformis Me
and themainformis an entirely separate object.
Forms![MRA Form_JPS]!Label113.BackColor


"Access User" wrote in message
...
Hi,


Mymainformis called "MRA Form_JPS" and has a child sub-formcalled
"subfrm_Aneurism". When thevalueof a control on thesubformcalled
"Aneurism" reaches more than 4, I want the backcolor of a label called
"Label113" on themainformto go vbred, so I coded the following thinking
I
had it


Private Sub Aneurism_AfterUpdate()


IfMe.Aneurism 4Then
* *Me.[MRA Form_JPS]!Label113.BackColor = vbRed
* *Else
* *Me.[MRA Form_JPS]!Label113.BackColor = vbWhite
EndIf


End Sub


but it doesn't work yet.


Is there something goofy about the way the above's wrote, or does it have
to
do with the fact that Aneurism gets its values automatically from this VBA
code below:


Private Sub Form_BeforeUpdate(Cancel As Integer)


Me.[Aneurism] = Nz(DMax("[Aneurism]", "qry_Aneurism_JPS", "ID=" _
& Me.ID), 0) + 1


End Sub


???- Hide quoted text -


- Show quoted text -


- Google Groups comes through again, this helped me tremendously...
Thanks! - Aaron

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 01:55 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.