BFanguy
asked on
Access 2010 need to know how to reference the text box name from Control Source
I have a text box on a form that calls a function in the Control Source that i want to pass the text box's name so within the function i can set backcolor, forecolor...
I don't want to have to hard code the text box's name within the call to the function.
=ELookup(??currenttextbox. name??, status)
Public Function ELookup(textboxname as ?control?, Status As String)
If Status = "x" then
textboxname.forecolor = vbred
Else
textboxname.forecolor = vbGreen
End Function
would i also have to pass the form name within the function?
I don't want to have to hard code the text box's name within the call to the function.
=ELookup(??currenttextbox.
Public Function ELookup(textboxname as ?control?, Status As String)
If Status = "x" then
textboxname.forecolor = vbred
Else
textboxname.forecolor = vbGreen
End Function
would i also have to pass the form name within the function?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks gustav
ASKER
I did Find a work around, unfortunately, I can't remember what i did, but it working.