A
Andrew
I have a function where I want to pass a reference to a control to the
function. The Function header is:
Public Function Search(ctlText As Control, strField As String) As Variant
I then call this function from the On Change event of a textbox from a form
with the following call:
varRetval = Search(Me.txtSearchName, “Nameâ€)
When I run this code the control Me.txtSearchName comes back as NULL and so
the the call to the function works but nothing is passed because
Me.txtSearchName is equal to NULL. I have checked to make sure I have the
right name for the textbox and cannot figure out why I cannot get a reference
to the text box. Any help would be great I am using Access 2007 and the
database is in the 2003 format.
function. The Function header is:
Public Function Search(ctlText As Control, strField As String) As Variant
I then call this function from the On Change event of a textbox from a form
with the following call:
varRetval = Search(Me.txtSearchName, “Nameâ€)
When I run this code the control Me.txtSearchName comes back as NULL and so
the the call to the function works but nothing is passed because
Me.txtSearchName is equal to NULL. I have checked to make sure I have the
right name for the textbox and cannot figure out why I cannot get a reference
to the text box. Any help would be great I am using Access 2007 and the
database is in the 2003 format.