Move Navigation Buttons on Form?

whdyck

Registered User.
Local time
Today, 05:29
Joined
Aug 8, 2011
Messages
169
I'm using MS Access 2003.

Is it possible to move the navigation buttons from the standard position (bottom left of the form footer) to, say, the header?

As a second question, is it possible to extract the information from the navigation buttons so that I can insert that data into a heading? Say I have the heading "Customer" and I want it to say "Customer (5 of 120)" without displaying the buttons. Is there an easy way to do this?

Thanks for your help.

Wayne
 
I'm using MS Access 2003.

Is it possible to move the navigation buttons from the standard position (bottom left of the form footer) to, say, the header?
No, but you can create your own buttons.
As a second question, is it possible to extract the information from the navigation buttons so that I can insert that data into a heading? Say I have the heading "Customer" and I want it to say "Customer (5 of 120)" without displaying the buttons. Is there an easy way to do this?
I would downplay the record number if possible. It has nothing to do with the records. It only is a relative number based on the current recordset that the form is using. It isn't always going to be on the same record when it says 5. If you add/delete records it will potentially change, depending on where the records fall in the sort that is currently being used, and if there is no sort being applied (either in the form's Order By property or if just using a query with no sort or just using a table for the record source) then it can bounce around each time you open the form.

So, I suggest getting users acclimated to NOT using that and hiding it and just using your own navigation buttons is a good way to do that.
 
I didn't tell all of the story.

The form I'm concerned about is actually a subform that displays only a single record at a time. So when the user sees the master alongside the child, it would be nice to inform the user the number of child records belonging to the displayed master record. Right now I have my own custom navigation buttons without the record counts. But the users have commented that it would be nice to know how many child recs they have to deal with. (Most masters have only a single child, so knowing the masters that have more than one child would be especially helpful.)

Reason I created my own navigation buttons is that the users have a harder time understanding the VCR buttons than an English-labelled button. But perhaps my only option is to go back to the built-in navigation buttons.

Thanks.

Wayne
 
Here's something that SHOULD work for you:

Code:
Private Sub Form_Current()
Dim rst As DAO.Recordset
 
Set rst = Me.RecordsetClone
 
Me.YourTextBoxHere = Me.Recordset.AbsolutePosition + 1 & " of " & rst.RecordCount
 
rst.close
Set rst = Nothing
End Sub
 
Thanks. This works, except that it initially always displays "1 of 1". (If I then click the Next button, it corrects itself.) The Form_Current event definitely needs this code, but I think I also need this code somewhere else after all the retrievals on the subform (and its subforms) have completed.

Any ideas where the best place would be? Is there an event on the parent that fires after everything is finished on the child forms?

Sorry if I should know this. I've googled for Access form event order, but I'm not having much luck.

Thanks.

Wayne
 
Here you go. Paste this into a standard module:
Code:
Function GetRSCount(frm As Form) As String
    Dim rst As DAO.Recordset
 
    Set rst = frm.RecordsetClone

    rst.MoveLast

GetRSCount = frm.Recordset.AbsolutePosition + 1 & " of " & rst.RecordCount

rst.Close

Set rst = Nothing

End Function

And then just put
=GetRSCount([Form])
into the Control Source of the text box. (just leave the [Form] part exactly as shown.

Or, you can modify your current code to add the MoveLast part on the RecordsetClone. But I broke it out to a separate function so it could be used in any form.
 

Users who are viewing this thread

Back
Top Bottom