what i'm trying to do is combine several virtually identical functions into one, and use a Select Case statement to differentiate the buttons that will be clicked. i've done it once already and it works perfectly. now the issue i'm having is with saving a field name and property (i.e. txtRDoc1Date.Value) as a string variable for use in comparisons later in the function. is this possible? what i have now is this:
the code above does not seem to work. i'm guessing it's because i can't store "txtRDoc1Date.Value" as a string and still have it function as if it were an object and a property. can anyone shed some light on this?
thanks in advance,
jas
Code:
Private Function DateButtonHandler(intButton as Integer)
Dim strReceivedDocDate as String
Dim strSentDocDate as String
Select Case (intButton)
Case 1: strReceivedDocDate = "txtRDoc1Date.Value"
strSentDocDate = "txtSDoc1Date.Value"
Case 2:
|
|
Case 6: etc, etc.
End Select
If (IsNull(strReceivedDocDate) = True) Then
--fill in fields here--
End If
the code above does not seem to work. i'm guessing it's because i can't store "txtRDoc1Date.Value" as a string and still have it function as if it were an object and a property. can anyone shed some light on this?
thanks in advance,
jas