Solved

Access 2010 class of form navigation buttons?

Posted on 2013-06-10
8
653 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
8 Comments
 
LVL 84
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 47

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
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 

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 57
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 47

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 47

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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Add records to a form to a table 11 37
Modal form 11 29
Where does the SQL and Design Columns Hide when converting a Select Query To an Update? 19 48
Filter a form 8 13
When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

776 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