Assuming you have put your global variable and the function in a module...<br>
<br>
If, once the user has entered their text, they have to click on an "OK" or "Go" kind of button, then you set the "OnClick" property of the button to [Event Procedure]. Once this is done, you can click button with the three dots to the right of this and you will be taken to the forms class module, with the cursor inside the buttons Click event. This is code that is run when the user clicks on the button. Simply add the code<br>
<br>
gstrUserText = Me.text_box_name_here<br>
<br>
and when the user clicks the button, the value of the text box will be assigned to the variable.<br>
<br>
If, up to now, you'd used a macro to do stuff after the user entered the text, you can either run this from the code ( use DoCmd.RunMacro macro_name_here ) or convert the macro into VBA (there's an add in that will do this for you, but you'll have to play around with it after...)<br>
<br>
Jonathan