In the example I provided the value of the unbound control is evaluated in a gated check.
Code:
If Me.lineDefault.Value > 0 Then
lngLineID = Me.lineDefault.Value
Else
From there, you can use the variable, lngLineID , as an argument.
When you call a procedure or a function you may need to provide an argument. If the sub or the function has a parameter, you will need to provide an argument. The exception is if the parameter is an optional parameter.
Code:
applyRecordset lngLineID
In calling the sub procedure above, there is the requirement of one argument to be provided for the parameter, p_lineID.
Code:
Private Sub applyRecordset(ByVal p_lineID As Long)
When you build code to call a sub or a function, you can use the hints provided by the VBA editor to determine what the parameters are and what data types the arguments provided need to be. For instance, as you type the name of the sub and then hit the space bar on your keyboard, the hints for the parameters, if any, will appear.
Give it a try. Type applyRecordset and then hit the space key.