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. |
|
|
|
Thread Tools | Display Modes |
#11
|
|||
|
|||
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 | |
|
|