Is thier any better way of formatting data in a datareport then this. I really don't know much about the datareport. I was wondering if thier were any thing on the desiner I could use.

Dim WithEvents PolNum As StdDataFormat
Dim deReport As New DataEnvironment1
Dim rsReport As New Recordset


Private Sub DataReport_Initialize()
'You can control the format of bound fields through the Format event of a StdDataFormat object
'Beccause this event fires each time a value is read from the data source
'it offers a way to execute your custon code each time a record is about to be displayed on
'the report

'Retrieve temp query to referecne when the data changes (same as rpt)
deReport.NewClaimReport
Set rsReport = deReport.rsNewClaimReport
rsReport.MoveFirst

'create a stdDataFormat object, and assign it to the txtpolicy_no field
Set PolNum = New StdDataFormat
Set Sections("Section1").Controls("txtpolicy_no").DataFormat = PolNum

End Sub



****format policy number******

Private Sub PolNum_Format(ByVal DataValue As StdFormat.StdDataValue)

Dim strMM As String
Dim strDD As String
Dim strYY As String
Dim strReportPolNum As String, strTempPolNum As String, strTempDate As String, _
strTempClaimSeqNo As String
With rsReport
strTempPolNum = DataValue.Value
strMM = Mid$(!date_of_loss, 5, 2)
strDD = Right$(!date_of_loss, 2)
strYY = Mid$(!date_of_loss, 3, 2)
strTempDate = strMM & strDD & strYY
strTempClaimSeqNo = !claim_sequence_no
strReportPolNum = strTempPolNum & strTempDate & strTempClaimSeqNo
DataValue.Value = strReportPolNum
.movenext
End With
End Sub