M
martinmike2
Hello,
I am trying to create a custom function for my application. I have
never done this before. What I am trying to do is:
on the click event of an unbound textbox I want to set the value to
"X". normally I would just do this in the sub for the control,
however my form is a checklist so i have many of these unbound
textboxes. Also, there are multiple forms with this functionality. I
ave tried running the following code:
Public Function SetNotNeeded(ctlToUpdate As Control)
If IsNull(ctlToUpdate) = True Then
ctlToUpdate.Value = "X"
Else
ctlToUpdate.Value = Null
End If
End Function
and in the control i run:
Private Sub Text57_Click()
SetNotNeeded (Text57)
End Sub
When i click in the box, i get the "Object Required" error.
I am trying to create a custom function for my application. I have
never done this before. What I am trying to do is:
on the click event of an unbound textbox I want to set the value to
"X". normally I would just do this in the sub for the control,
however my form is a checklist so i have many of these unbound
textboxes. Also, there are multiple forms with this functionality. I
ave tried running the following code:
Public Function SetNotNeeded(ctlToUpdate As Control)
If IsNull(ctlToUpdate) = True Then
ctlToUpdate.Value = "X"
Else
ctlToUpdate.Value = Null
End If
End Function
and in the control i run:
Private Sub Text57_Click()
SetNotNeeded (Text57)
End Sub
When i click in the box, i get the "Object Required" error.