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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RecordCount & Current record

Status
Not open for further replies.

DrDan1

Technical User
Oct 2, 2002
127
GB
Can anyone tell me how I would return values for CurrentRecord and Total Records.

i.e. If CurrentRecord = TotalRecords Do something

I'd apreciate any help. Thanks. ----------------------------------------
Knowing is not enough, we must apply. Willing is not enough, we must do.
--So said the ever wise Bruce Lee
Memorize and live by it!
 
Hi

.RecordCount gives you number of records in the recordset

.AbsolutePosition gives you the number of the current row within the recordset ie returns a number 0 thru .recordcount -1 Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Hmm. I got this below that works. It disables the goto previous record button if there are none:

If CurrentRecord = 1 Then
Me!previous.Enabled = False
Else: Me!previous.Enabled = True
End If


Disabling the next button is where I hit a wall:

If CurrentRecord = RecordCount Then
Me!next.Enabled = False
Else: Me!next.Enabled = True
End If

It won't disable the button at all. ----------------------------------------
Knowing is not enough, we must apply. Willing is not enough, we must do.
--So said the ever wise Bruce Lee
Memorize and live by it!
 
Doh. All I needed to do was add recordset.

If CurrentRecord = Recordset.RecordCount Then
Me!next.Enabled = False
Else: Me!next.Enabled = True
End If



----------------------------------------
Knowing is not enough, we must apply. Willing is not enough, we must do.
--So said the ever wise Bruce Lee
Memorize and live by it!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top