Hi guys,
I don't know if anyone will find this useful but I sure did. This is a function I include in most of my vb apps to set a report formula's value.
Public Sub gSetReportFormulaValue(ByRef oReport As CRAXDRT.Report, sFormulaName As String, sValue As String, Optional ByVal bQuotes As Boolean = True)
Dim lFormulaCount As Long
If bQuotes Then sValue = """" & sValue & """"
For lFormulaCount = 1 To oReport.FormulaFields.Count
If oReport.FormulaFields(lFormulaCount).FormulaFieldName = sFormulaName Then
oReport.FormulaFields(lFormulaCount).Text = sValue
End If
Next
End Sub
Transcend
I don't know if anyone will find this useful but I sure did. This is a function I include in most of my vb apps to set a report formula's value.
Public Sub gSetReportFormulaValue(ByRef oReport As CRAXDRT.Report, sFormulaName As String, sValue As String, Optional ByVal bQuotes As Boolean = True)
Dim lFormulaCount As Long
If bQuotes Then sValue = """" & sValue & """"
For lFormulaCount = 1 To oReport.FormulaFields.Count
If oReport.FormulaFields(lFormulaCount).FormulaFieldName = sFormulaName Then
oReport.FormulaFields(lFormulaCount).Text = sValue
End If
Next
End Sub
Transcend