Solved

Access 2010 class of form navigation buttons?

Posted on 2013-06-10
8
623 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
 

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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
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…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

706 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now