I have a function in a module that runs a query and prints to a form's text box.Let's look at an example.
function dostuff( variable as Variant )
... (code to do the query)...
variable = rs![field name] 'rs is the recordset created
end function
if i call the following from a button's onclick( ), the textbox on the form will not be populated:
dostuff Me.textbox
However if I do: dostuff Me and in the dostuff() function i change the line to variable.textbox = rs![field name], everything will work fine. Why is this AND how do I reference the textbox from the function so that i can make this more dynamic.
function dostuff( variable as Variant )
... (code to do the query)...
variable = rs![field name] 'rs is the recordset created
end function
if i call the following from a button's onclick( ), the textbox on the form will not be populated:
dostuff Me.textbox
However if I do: dostuff Me and in the dostuff() function i change the line to variable.textbox = rs![field name], everything will work fine. Why is this AND how do I reference the textbox from the function so that i can make this more dynamic.