Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 739
  • Last Modified:

Access 2010 class of form navigation buttons?

Many years ago I used FoxPro and loved the "class" concept. A the time, it was even extended to customized form navigation buttons.  When I design a form, I like to give my users a selection of buttons ( Next, Previous, Add Save, etc) that are bigger and also give me more control of what happens when they are pressed. In Fox, I could make the buttons once, grab hem as a group and place them on a new form.   This saved a lot of time vs creating each button for a form

Is there a way to do this in Access 2010?

Jerry
0
GNOVAK
Asked:
GNOVAK
2 Solutions
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
Many people use a subform for this. Just create your subform, add the necessary code to make things work, and then use that subform as needed for nav buttons. If you set the subform and subcontrol properties correctly, it won't look like a subform (i.e. no border, etc etc).

Access supports classes, and can use them in much the same way that Visual Basic does. It does not support all concepts of OOP programming, but I've never needed anything class related that Access couldn't do.
0
 
Dale FyeCommented:
I generally just create these on the fly nowadays, putting them in the form footer.

At one point, I had a subform that I used that contained all of my custom navigation buttons, but the problem was that whenever you set the focus to a control on the navigation subform, the main form would save the current record.  I finally just decided to code these buttons in the forms footer each time I use them.

I generally have a subroutine called buttons, that I call in the click event of each of the navigation, Cancel, Save, and Close buttons.

The attached file is an example of the form, controls, and code I use for my navigation buttons.  These change occasionally, but are pretty standard.

You can copy the buttons from this form, then copy the code as well and paste it into any form, but you will need to make sure that the buttons are actually linked to the code in the properties dialog, event tab.
NavButtons.accdb
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
You can adopt Steven's Nav Button scheme for this:

http://www.lebans.com/recnavbuttons.htm

mx
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
GNOVAKAuthor Commented:
fyed -
Like the centralized solution!
I haven't worked with clones of a recordset before.
Couple of questions. As I will have a LARGE dataset from Oracle, will cloning a recordset be an issue?
Does the clone allow me to add _ I didn't see any code for add..?
Any problems in multiuser environment?
0
 
Jim Dettman (Microsoft MVP/ EE MVE)PresidentCommented:
Jerry,

<<In Fox, I could make the buttons once, grab hem as a group and place them on a new form.   This saved a lot of time vs creating each button for a form>>

 As an aside; forget anything you did with Foxpro except in concept only.   Access is a totally different animal and is not oop based.

  While it does have some inheritance in VBA for objects, it's not full inheritance and frankly, from my viewpoint, makes classes in VBA pretty useless (others will disagree).

 I've used both products and you just can't do things the same way with either.  Simple example; in VFP, almost everything is done via command window.  In Access, everything is pretty much GUI.

  A good example of that is the query designer in VFP...most VFP developers don't use it because it doesn't work all that well, while in the Access world, the query designer is used heavily.

  Another example, the data environment of a form in VFP far surpasses what you can do in an Access form.

 I often have said in the past that it was a shame Microsoft did not take the best of Access and roll it into VFP.   They would have had a killer product.   Sad to say though, those times are well past now.

Jim.
0
 
Dale FyeCommented:
1.  You should have not problem working with the recordset clone

2.  You can add records through the clone, but that is not the technique used here.  There is a "New Record" button just to the right of the Last button.  That will take you to a new record.  If you are using tables linked via ODBC from Oracle, you should be able to use this technique to add a new record.  However, if your Forms recordset is based on a stored procedure or pass-thru query to Oracle, that might not work.

3.  Should not be a problem for multi-user environment as each user is controlling their own form.  However, if you have multiple users that might be accessing the same record at the same time, then there are additional steps to consider.
0
 
GNOVAKAuthor Commented:
fyed -
A post question -
The BUTTONS sub doesnt appear to be moveable from the specific form because of a reference to ME.RecordSetClone.
The form name could be passed - just have to change the button call.
Did you do anything different?
0
 
Dale FyeCommented:
I generally just copy the Buttons code from one form to another.  You could modify it to make it more generic by putting it in a generic code module and passing it a form as an argument, but the code for checking required fields in the save button is specific to a particular form, so I find it easier just to put it in the form where the buttons are located.
0

Featured Post

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now