Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting a Report Formula from VB

Status
Not open for further replies.

Transcend

Programmer
Sep 29, 2002
858
AU
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
[gorgeous]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top