O
open a adobe file from a command button
I'm using this code from a post in 2006 to try and change the fore/back color
of txt boxes but I can't get it to work. I get a error saying "The
expression you entered has a function name that Access can't find but I can't
see it. Would someone look at it? Please
Const cLostFocusBackColor = 12632256
Const cLostFocusForeColor = 8388608
Const cGotFocusBackColor = 32768
Const cGotFocusForeColor = 16777215
Private Function SetLabelColors(sLabelName As String, fGotFocus As Boolean)
Dim lbl As Label
On Error Resume Next
Set lbl = Me.Controls(sLabelName)
If fGotFocus Then
lbl.BackColor = cGotFocusBackColor
lbl.ForeColor = cGotFocusForeColor
Else
lbl.BackColor = cLostFocusBackColor
lbl.ForeColor = cLostFocusForeColor
End If
End Function
and in the got/lost focus of the properties of the text box is
=setLabelcolors("lblRegion",True)
=setLabelcolors("lblRegion",False)
Thank you again!!!
of txt boxes but I can't get it to work. I get a error saying "The
expression you entered has a function name that Access can't find but I can't
see it. Would someone look at it? Please
Const cLostFocusBackColor = 12632256
Const cLostFocusForeColor = 8388608
Const cGotFocusBackColor = 32768
Const cGotFocusForeColor = 16777215
Private Function SetLabelColors(sLabelName As String, fGotFocus As Boolean)
Dim lbl As Label
On Error Resume Next
Set lbl = Me.Controls(sLabelName)
If fGotFocus Then
lbl.BackColor = cGotFocusBackColor
lbl.ForeColor = cGotFocusForeColor
Else
lbl.BackColor = cLostFocusBackColor
lbl.ForeColor = cLostFocusForeColor
End If
End Function
and in the got/lost focus of the properties of the text box is
=setLabelcolors("lblRegion",True)
=setLabelcolors("lblRegion",False)
Thank you again!!!