G
Guest
I have several global variables that are of type INTEGER with simular names
and would like to reference them in code. for example intPHOpen,
intPHDAOpen, intPHTROpen
my code loopes through records and I want the RecordType and Category (PH,
TR, DA) to determine which variable should have a value added to it.
I have a variable called strVarName that is the set to the name of the
globla variable that I want to reference
I am having trouble in the SELECT CASE section of my code. There is where I
want to add value to the global variable (strVarName) . currently my code
looks like this
--------------------------------------
Do Until SourceRS.EOF
If SourceRS!Type = "M" Then
'add value to Multifamily open count
intMFOpen = intMFOpen + SourceRS!countvalue
strVarName = "intMF"
ElseIf SourceRS!Type = "P" Then
'add value to PublicHousing opencount
intPHOpen = intPHOpen + SourceRS!countvalue
strVarName = "intPH"
End If
Select Case SourceRS!Category
Case "DA"
strVarName = strVarName & "DAOpen"
strVarName.Value = strVarName.Value + SourceRS!countvalue
Case "TC"
Case "TR"
End Select
....
----------------------------
I am having problems in the section of code that says:
strVarName.value = strVarName.Value + SourceRS!CountValue
I know it is something simple I should do instead
note: strVarName = intPHDAOpen or intMFDAOpen
this is the name of my global variable that I want to add value to
and would like to reference them in code. for example intPHOpen,
intPHDAOpen, intPHTROpen
my code loopes through records and I want the RecordType and Category (PH,
TR, DA) to determine which variable should have a value added to it.
I have a variable called strVarName that is the set to the name of the
globla variable that I want to reference
I am having trouble in the SELECT CASE section of my code. There is where I
want to add value to the global variable (strVarName) . currently my code
looks like this
--------------------------------------
Do Until SourceRS.EOF
If SourceRS!Type = "M" Then
'add value to Multifamily open count
intMFOpen = intMFOpen + SourceRS!countvalue
strVarName = "intMF"
ElseIf SourceRS!Type = "P" Then
'add value to PublicHousing opencount
intPHOpen = intPHOpen + SourceRS!countvalue
strVarName = "intPH"
End If
Select Case SourceRS!Category
Case "DA"
strVarName = strVarName & "DAOpen"
strVarName.Value = strVarName.Value + SourceRS!countvalue
Case "TC"
Case "TR"
End Select
....
----------------------------
I am having problems in the section of code that says:
strVarName.value = strVarName.Value + SourceRS!CountValue
I know it is something simple I should do instead
note: strVarName = intPHDAOpen or intMFDAOpen
this is the name of my global variable that I want to add value to