Hi
You do not indicate what application you are running the code in, but, on the basis that the form is open, then, if its Excel or Access (and I suspect .NET or any other language?) then you need to refer to the form Object/Class by name something like this
In Excel
- Public Function HoldReleaseLot(ByRef sActionType As String) As String
-
UserForm1.HoldType sActionType
-
End Function
In Access like this
- Public Function HoldReleaseLot(ByRef sActionType As String) As String
-
Form_YourFormName.HoldType sActionType
-
End Function
OR like this
- Public Function HoldReleaseLot(ByRef sActionType As String) As String
-
Forms("YourFormName").HoldType sActionType
-
End Function
HTH
Note sure what the ultimate doing, but as it stands both HoldType and HoldReleaseLot could be a Subs rather that a Functions!?
MTB