I have a couple of code segments that are very similar, and I want to replace them with a subroutine.
The code opens a stores a value on the current form in a variable, opens a new form, and places the content of the variable in a text box on the new form.
Dim Var_UserID As Long
Var_UserID = Me.txt_StoreUserID
DoCmd.OpenForm "frm_TechUseHome"
[Forms]![frm_TechUseHome]![txt_HidUserID] = Var_UserID
[Forms]![frm_TechUseHome].Refresh
End Sub
If I call this as a sub-routine, how will I pass the reference to the field and form?