Hi Everyone,
i have the following code that I use to display x of y records for certain records in a form. I use the unbound textbox txtCardCount to display the info as the user navigates thru the form. I have a report version of the form that I use to print off but how do i convert the code to use in the report so that it also prints for every record since I have no "onCurrent" event and no recordsetclone object? Any help would be really appreciated.
thanks in advance
GPM
Public Sub CountSOCards()
Dim rst As DAO.Recordset
Dim lngBaseCount, lngRecord, lngTotalSO As Long
On Error Resume Next
Set rst = Me.RecordsetClone
rst.MoveFirst
rst.FindFirst "[SO]='" & Me.SO & "'"
lngBaseCount = rst.AbsolutePosition
lngTotalSO = DCount("UNIQID", "qryProduction", "[SO]='" & Me.SO & "'")
lngRecord = Me.CurrentRecord - lngBaseCount
'Show the result of the record count in the text box )
Me.txtCardCount = "Items on SO: " & lngRecord & " of " & lngTotalSO
Set rst = Nothing
End Sub
i have the following code that I use to display x of y records for certain records in a form. I use the unbound textbox txtCardCount to display the info as the user navigates thru the form. I have a report version of the form that I use to print off but how do i convert the code to use in the report so that it also prints for every record since I have no "onCurrent" event and no recordsetclone object? Any help would be really appreciated.
thanks in advance
GPM
Public Sub CountSOCards()
Dim rst As DAO.Recordset
Dim lngBaseCount, lngRecord, lngTotalSO As Long
On Error Resume Next
Set rst = Me.RecordsetClone
rst.MoveFirst
rst.FindFirst "[SO]='" & Me.SO & "'"
lngBaseCount = rst.AbsolutePosition
lngTotalSO = DCount("UNIQID", "qryProduction", "[SO]='" & Me.SO & "'")
lngRecord = Me.CurrentRecord - lngBaseCount
'Show the result of the record count in the text box )
Me.txtCardCount = "Items on SO: " & lngRecord & " of " & lngTotalSO
Set rst = Nothing
End Sub