Solved

Access 2010 class of form navigation buttons?

Posted on 2013-06-10
8
690 Views
Last Modified: 2013-06-11
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
Comment
Question by:GNOVAK
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 85
ID: 39236494
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
 
LVL 48

Assisted Solution

by:Dale Fye (Access MVP)
Dale Fye (Access MVP) earned 500 total points
ID: 39236592
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
 
LVL 75
ID: 39236684
You can adopt Steven's Nav Button scheme for this:

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

mx
0
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 

Author Comment

by:GNOVAK
ID: 39237582
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
 
LVL 58
ID: 39237767
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
 
LVL 48

Accepted Solution

by:
Dale Fye (Access MVP) earned 500 total points
ID: 39237958
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
 

Author Comment

by:GNOVAK
ID: 39239250
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
 
LVL 48

Expert Comment

by:Dale Fye (Access MVP)
ID: 39239468
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

Industry Leaders: 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!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question