Display Current Record and Total Records

J

Jeff

I created a form and inserted command buttons to navigate between records so
that I can hide the form navigation buttons. Everything works fine, but I am
unable to display the current record and total records. Should I use a text
box?
 
J

Jeff

Thank you for your help!!! I added an unbound text box and the code provided
to the OnCurrent event of the Microsoft Access form, as instructed. However,
I receive the following error and the code detailed below is highlighted.
I'm not sure what to do.

Complie error:
User-defined type not defined

Private Sub Form_Current() - HIGHLIGHTED

' Provide a record counter for using with
' custom navigation buttons (when not using
' Access built in navigation)

Dim rst As DAO.Recordset - HIGHLIGHTED
Dim lngCount As Long

Set rst = Me.RecordsetClone

With rst
.MoveFirst
.MoveLast
lngCount = .RecordCount
End With

'Show the result of the record count in the text box (txtRecordNo)

Me.txtRecordNo = "Record " & Me.CurrentRecord & " of " & lngCount

End Sub
 
T

tkelley via AccessMonster.com

Go to Tools|References and see what version of DAO you are referencing. I
have 3.6 for Access 2003.
Thank you for your help!!! I added an unbound text box and the code provided
to the OnCurrent event of the Microsoft Access form, as instructed. However,
I receive the following error and the code detailed below is highlighted.
I'm not sure what to do.

Complie error:
User-defined type not defined

Private Sub Form_Current() - HIGHLIGHTED

' Provide a record counter for using with
' custom navigation buttons (when not using
' Access built in navigation)

Dim rst As DAO.Recordset - HIGHLIGHTED
Dim lngCount As Long

Set rst = Me.RecordsetClone

With rst
.MoveFirst
.MoveLast
lngCount = .RecordCount
End With

'Show the result of the record count in the text box (txtRecordNo)

Me.txtRecordNo = "Record " & Me.CurrentRecord & " of " & lngCount

End Sub
I think this is what you're trying to do:
[quoted text clipped - 4 lines]
 
J

Jeff

References is not available in the Tools menu - I am running Access 2000 and
according to help - DAO version is 3.6. Not sure what to do...

tkelley via AccessMonster.com said:
Go to Tools|References and see what version of DAO you are referencing. I
have 3.6 for Access 2003.
Thank you for your help!!! I added an unbound text box and the code provided
to the OnCurrent event of the Microsoft Access form, as instructed. However,
I receive the following error and the code detailed below is highlighted.
I'm not sure what to do.

Complie error:
User-defined type not defined

Private Sub Form_Current() - HIGHLIGHTED

' Provide a record counter for using with
' custom navigation buttons (when not using
' Access built in navigation)

Dim rst As DAO.Recordset - HIGHLIGHTED
Dim lngCount As Long

Set rst = Me.RecordsetClone

With rst
.MoveFirst
.MoveLast
lngCount = .RecordCount
End With

'Show the result of the record count in the text box (txtRecordNo)

Me.txtRecordNo = "Record " & Me.CurrentRecord & " of " & lngCount

End Sub
I think this is what you're trying to do:
[quoted text clipped - 4 lines]
unable to display the current record and total records. Should I use a text
box?
 
T

tkelley via AccessMonster.com

If references wasn't available, then you probably weren't in the coding
window when you tried. You might just go double-check it there.
References is not available in the Tools menu - I am running Access 2000 and
according to help - DAO version is 3.6. Not sure what to do...
Go to Tools|References and see what version of DAO you are referencing. I
have 3.6 for Access 2003.
[quoted text clipped - 35 lines]
 
J

Jeff

I greatly apologize for wasting your time...

Almost none of the references are loaded.

All is working now...
Thank you very much for your help!!!

Do you mind if I contact you in the future?


tkelley via AccessMonster.com said:
If references wasn't available, then you probably weren't in the coding
window when you tried. You might just go double-check it there.
References is not available in the Tools menu - I am running Access 2000 and
according to help - DAO version is 3.6. Not sure what to do...
Go to Tools|References and see what version of DAO you are referencing. I
have 3.6 for Access 2003.
[quoted text clipped - 35 lines]
unable to display the current record and total records. Should I use a text
box?
 
T

tkelley via AccessMonster.com

You didn't waste my time. That kind of stuff is exactly what this site is
for ... synergy.

I'll be happy to try to help anytime.
I greatly apologize for wasting your time...

Almost none of the references are loaded.

All is working now...
Thank you very much for your help!!!

Do you mind if I contact you in the future?
If references wasn't available, then you probably weren't in the coding
window when you tried. You might just go double-check it there.
[quoted text clipped - 7 lines]
 
1

123

ÌìÆøÁ¹ÁË£¡
tkelley via AccessMonster.com said:
If references wasn't available, then you probably weren't in the coding
window when you tried. You might just go double-check it there.
References is not available in the Tools menu - I am running Access 2000 and
according to help - DAO version is 3.6. Not sure what to do...
Go to Tools|References and see what version of DAO you are referencing. I
have 3.6 for Access 2003.
[quoted text clipped - 35 lines]
unable to display the current record and total records. Should I use a text
box?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top