J
JohnE
Hello NG. I have a form that I am adding a txt box to
that will display the number of records associated to a
client code. Below is the code that I have so far and it
works. The exception is when I have a client that does
not have any info on the form as of yet. So before I can
even add any info, as soon as I bring a client up on the
form I get an error because of no info. I can not figure
out how to place the code for not having any records.
****************
Private Sub Form_Current()
Dim rst As dao.Recordset
Dim lngCount As Long
Set rst = Me.RecordsetClone
With rst
.MoveFirst
.MoveLast
lngCount = .RecordCount
End With
Me.txtRecordNumber = "Record" & Me.CurrentRecord
& "of" & lngCount
End Sub
*****************
If anyone can help out, thanks.
*** John
that will display the number of records associated to a
client code. Below is the code that I have so far and it
works. The exception is when I have a client that does
not have any info on the form as of yet. So before I can
even add any info, as soon as I bring a client up on the
form I get an error because of no info. I can not figure
out how to place the code for not having any records.
****************
Private Sub Form_Current()
Dim rst As dao.Recordset
Dim lngCount As Long
Set rst = Me.RecordsetClone
With rst
.MoveFirst
.MoveLast
lngCount = .RecordCount
End With
Me.txtRecordNumber = "Record" & Me.CurrentRecord
& "of" & lngCount
End Sub
*****************
If anyone can help out, thanks.
*** John