G
Guest
I am trying to pass the name of a form field object to a function. The Set
statement doesn't recognize the arguement as a variant or control data type.
For example:
Function testfunction(cvlistbox As Variant)
' specify the list box
Set cvlist = Me!cvlistbox
cvselected = cvlist.ItemsSelected.Count
If cvselected = 0 Then
MsgBox err_no_selection
End If
MsgBox "selection acknowledged"
End Function
Simply setting a variable to the value of an object doesn't work using an
arguement either. For example, cvJoinTwo = Me![index_persons] assigns the
value, but cvJoinTwo = Me!arguement does not.
How do I pass the name of an object to a function? (Thanks in advance for
your help.)
statement doesn't recognize the arguement as a variant or control data type.
For example:
Function testfunction(cvlistbox As Variant)
' specify the list box
Set cvlist = Me!cvlistbox
cvselected = cvlist.ItemsSelected.Count
If cvselected = 0 Then
MsgBox err_no_selection
End If
MsgBox "selection acknowledged"
End Function
Simply setting a variable to the value of an object doesn't work using an
arguement either. For example, cvJoinTwo = Me![index_persons] assigns the
value, but cvJoinTwo = Me!arguement does not.
How do I pass the name of an object to a function? (Thanks in advance for
your help.)