Link to home
Start Free TrialLog in
Avatar of BFanguy
BFanguyFlag for United States of America

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?
ASKER CERTIFIED SOLUTION
Avatar of Gustav Brock
Gustav Brock
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of BFanguy

ASKER

thanks,

I did Find a work around,  unfortunately, I can't remember what i did, but it working.
Avatar of BFanguy

ASKER

thanks gustav