Concatinate function

brampeirs

Registered User.
Local time
Today, 19:41
Joined
Jul 29, 2011
Messages
20
Hello,

I would like to do something like this:

Code:
'Called procedure
Public Sub SetBgLightBlue(buttenName As String)
Dim btnCaller As String
btnCaller = buttenName

Dim lngLightBlue As Long
lngLightBlue = RGB(223, 237, 254)

[B]btnCaller!BackColor = lngLightBlue[/B]
End Sub


'calling procedure
Private Sub starttime_GotFocus()
Me.SetBgLightBlue ("lblStartTime")
End Sub

I want it to replace btnCaller with the text lblStartTime (witch is a control on my form). but now it reads it as btnCaller.BackColor.

Can someone help me. THANK YOU!!!
 
I know this code works for changing field control's background...

Code:
    'Set the background color of the controls - Yellow for Production/JDE
    Me.fldparttitle.BackColor = RGB(255, 255, 119)
    Me.fldrev.BackColor = RGB(255, 255, 119)
    Me.fldver.BackColor = RGB(255, 255, 119)
    Me.fldvendortitle.BackColor = RGB(255, 255, 119)
A little bit different syntax, and I (for better or worse) hard code the color numbers all over the place. Or I use a constant if available...

Code:
    'Set the background color of the controls - White for Fandango
    Me.fldparttitle.BackColor = vbWhite
    Me.fldrev.BackColor = vbWhite
    Me.fldver.BackColor = vbWhite
    Me.fldvendortitle.BackColor = vbWhite
 

Users who are viewing this thread

Back
Top Bottom