D
default105
Access 2000, WinXP
Thanks in advance!
I have a form that pops up for a user to click on a button to input a number
into a form. I would like to add a conditional format to color the button
red if there is a value already in the textbox. I do not have any problem
doing this if I type in the name of the control in the function call, however
if I am trying to dynamically create it, it fails every time. Here is where
I am at so far (which I know is wrong), can anyone please tell me how to do
this?
Private Sub Form_Load()
Dim strBtn As String
Dim ctlBtn As Object
strBtn = "Me.Command" & Forms!frmOrders.txtPriority
Set ctlBtn = strBtn
Dim lngBool As Boolean
Dim lngBackColor As Long
' Call the Color Picker Dialog
' lngBackColor = aCmdDialogColor()
' If error set ForeColor to Black
' Pass the Selected Color to the function
Debug.Print lngBackColor
'lngBool = fCmdButTextPic(Me.Command0, lngBackColor)
lngBool = fCmdButTextPic(ctlBtn, 8388863)
Set ctlBtn = Nothing
End Sub
Thanks in advance!
I have a form that pops up for a user to click on a button to input a number
into a form. I would like to add a conditional format to color the button
red if there is a value already in the textbox. I do not have any problem
doing this if I type in the name of the control in the function call, however
if I am trying to dynamically create it, it fails every time. Here is where
I am at so far (which I know is wrong), can anyone please tell me how to do
this?
Private Sub Form_Load()
Dim strBtn As String
Dim ctlBtn As Object
strBtn = "Me.Command" & Forms!frmOrders.txtPriority
Set ctlBtn = strBtn
Dim lngBool As Boolean
Dim lngBackColor As Long
' Call the Color Picker Dialog
' lngBackColor = aCmdDialogColor()
' If error set ForeColor to Black
' Pass the Selected Color to the function
Debug.Print lngBackColor
'lngBool = fCmdButTextPic(Me.Command0, lngBackColor)
lngBool = fCmdButTextPic(ctlBtn, 8388863)
Set ctlBtn = Nothing
End Sub