ms-access


Custom Record Navigation


Hi I have an App with nested sub-forms, the record navigation is confusing and I've started moving the Record Navigation controls to the top of the forms to improve that. I'm stuck on the 'n of n' field, is there a generic property(s)/query that will give me this?
For the first n, use the AbsolutePosition property of the form's RecordsetClone. see MSDN
For the second n, use the RecordCount property.
Update: I prefer Mike's approach using CurrentRecord. I created a form with 2 text boxes: txtCurrentRecord and txtRecordCount. Then this procedure for the form's On Current event causes the text boxes to display the same values as the built-in navigation bar.
Private Sub Form_Current()
Me.txtCurrentRecord = Me.CurrentRecord
If Not Me.NewRecord Then
Me.txtRecordCount = Me.RecordsetClone.RecordCount
Else
Me.txtRecordCount = Me.CurrentRecord
End If
End Sub
Update2: I added a procedure to Form Load to make sure RecordCount is accurate.
Private Sub Form_Load()
Me.RecordsetClone.MoveLast
Me.RecordsetClone.MoveFirst
End Sub

Related Links

DSUM Formula Not Working
Format Currency to Group By Access Query
Trying to incorporate IIF in Select Statement
MS Access 2010 Issue
How to filter by date/time in an MS Access report?
How to get keyboard 'Enter' to trigger button press on Access form?
Access Import Error -1- 0
Highlight rows in listbox from values in recordset
How to activate button if a value is less than zero?
ms access query to join date table to Timesheet table
Forcing Microsoft Access to acknowledge that the a Microsoft Access ADE file exists
Error importing MS Access table to SAS
Data type mismatch in criteria expression Access error
MS Access: JOIN expression not supported
How to segregate a single value from a query in MS Access
Using a LocalDB database from MS Access

Categories

HOME
ms-access
java
amazon-ec2
activiti
drivers
onedrive
fme
rsyslog
packages
mvvmcross
django-imagekit
bs4
contact
session-variables
adobe-analytics
alignment
orchardcms
decomposition
clearcase-ucm
foselasticabundle
after-effects
jsdoc
karma-jasmine
visjs
excel-2007
hammerspoon
blazemeter
xpages-ssjs
saas
tasklet
file-rename
catch-all
textmate
gammu
normal-distribution
mmenu
sequential
restlet
multilingual
event-driven
objectlistview
optix
estimote
acoustics
s
thin
theming
spring-android
heidisql
elements
underscore.js-templating
essence
two-factor-authentication
spim
teamcity-8.0
spidermonkey
computer-algebra-systems
kcachegrind
varargs
service-accounts
sankey-diagram
device-orientation
apache-commons-net
javafx-webengine
socketexception
zend-route
starcluster
dml
navigationservice
typo3-neos
imdbpy
pygit2
typoscript2
bitsharp
trusted
ocx
removeclass
external-accessory
blackberry-playbook
cinema-4d
locationlistener
iphone-web-app
asp.net-mvc-areas
sortable-tables
web-application-design
modelstate
castle-monorail
virtual-functions
privilege
simpletest
project-hosting
gacutil

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App