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

The navigation buttons on a form????

Status
Not open for further replies.

lflee

Programmer
Mar 8, 2002
3
US
I would like to scroll through the RecordSetClone of my form then only display certain records depending on a condition when the navigation button is pressed. (Previous, next, etc.)
Using vba code, how can I tell what button was clicked on then choose the records to display?

I am using Access 2000, vba 6.0.
 
You can't trap the click of the little navigation buttons on the bottom of the form directly (that's why I don't like them) but you should be able to trap the CurrentRecord event, which fires every time Access "moves" to a different record. I'm just not sure you can tell whether it "next-ed" or "previous-ed" to it. Just that the record pointer has changed.

If you really want to be able to control it, I'd remove the navigation buttons and put your own on the form footer.

JMH Me? Ambivalent? Well, yes and no....
Another free Access forum:
More Access stuff at
 
Why not just change the recordset of the form? Then you won't have to get into any of this, and you won't be bringing over unneeded records.

Jeremy =============
Jeremy Wallace
AlphaBet City Dataworks

Take a look at the Developers' section of the site for some helpful fundamentals.
 
Jeremy,

If I put this statement in to limit the records in my recordset:

Dim rst As DAO.Recordset
Set db = CurrentDb()
Set rst = db.OpenRecordset("select * from Master where not isnull(Sentmonths)")

... Which event(s) do put it in if I want to read this recordset when the previous and next navigation buttons are clicked on?

I was thinking it should be on the Form_Load but I'm not sure where else I should put it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top