BrettM
just a pert, "ex" to come
- Local time
- Tomorrow, 04:22
- Joined
- Apr 30, 2008
- Messages
- 134
I have a need to modify a control on a form by using a string formula. I was trying to use Eval() but have now discovered that this doesn't do what I want. Here is my code...
I am trying to see if a control (Log101) has something in it. If it does then make Log102 visible. I know this is a simple task using the "On Change" property but this is only part of what is needed to do and there are 100 controls. I need a global sub that can simply be called and do what is required with a single line entry for the "On Change" - in this case it just says "AllowComboEdit" and the task should be done.
Can anyone help me with what should be used instead of Eval()?
Regards Brett
Code:
Public Sub AllowComboEdit()
frmName = Screen.ActiveForm.Name
PublicName1 = Screen.ActiveControl.Name
PublicName2 = (Left(PublicName1, Len(PublicName1) - 2)) & Val(Right(PublicName1, 2) + 1)
If Val(Right(PublicName2, 2)) < 99 Then
PublicVar = "Forms!" & frmName & "." & PublicName2 & ".Visible= True"
Eval (PublicVar)
' end result should be Forms!Timesheet.Log102.Visible = True
End If
End Sub
I am trying to see if a control (Log101) has something in it. If it does then make Log102 visible. I know this is a simple task using the "On Change" property but this is only part of what is needed to do and there are 100 controls. I need a global sub that can simply be called and do what is required with a single line entry for the "On Change" - in this case it just says "AllowComboEdit" and the task should be done.
Can anyone help me with what should be used instead of Eval()?
Regards Brett