473,395 Members | 2,253 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Go Back to the previous FORM

How can I create a button that would take me back to the previous form
not the previous record, but the previous form that I just moved from
using VBA? Any sample code would be greatly appreciated.

Nov 13 '05 #1
8 14058
Cheryl,
I think we need a little more information. Let me guess and we'll see
if it helps. I assume you have form A that is open and something on
it opens B. Now you want to close B so that you are looking at A.
Create a button on B - lets call it cmdBack
private sub cmdback_click()
forms!A.setfocus'brings the form to the front
docmd.close acform,me.name'will close the current form
end sub

Another way to manage multiple forms that is much easier for you to
manage and much easier for the user to navigate, is using tabs. You
can put a separate form on each tab. No more confusing poppng up
forms.
HTH
Pachydermitis

Nov 13 '05 #2
Cheryl,
I think we need a little more information. Let me guess and we'll see
if it helps. I assume you have form A that is open and something on
it opens B. Now you want to close B so that you are looking at A.
Create a button on B - lets call it cmdBack
private sub cmdback_click()
forms!A.setfocus'brings the form to the front
docmd.close acform,me.name'will close the current form
end sub

Another way to manage multiple forms that is much easier for you to
manage and much easier for the user to navigate, is using tabs. You
can put a separate form on each tab. No more confusing poppng up
forms.
HTH
Pachydermitis

Nov 13 '05 #3
rkc
Cheryl wrote:
How can I create a button that would take me back to the previous form
not the previous record, but the previous form that I just moved from
using VBA? Any sample code would be greatly appreciated.


In it's simplest form, pass the calling form's name to the called
form in the OpenArgs parameter of the Docmd.Open function.

Using the wizard lingo that would be
DoCmd.OpenForm stDocName, , , stLinkCriteria, , , Me.Name

To get back to the calling form
If you closed it: DoCmd.OpenForm Me.OpenArgs
If not: Forms.item(Me.OpenArgs).SetFocus


Nov 13 '05 #4
rkc
Cheryl wrote:
How can I create a button that would take me back to the previous form
not the previous record, but the previous form that I just moved from
using VBA? Any sample code would be greatly appreciated.


In it's simplest form, pass the calling form's name to the called
form in the OpenArgs parameter of the Docmd.Open function.

Using the wizard lingo that would be
DoCmd.OpenForm stDocName, , , stLinkCriteria, , , Me.Name

To get back to the calling form
If you closed it: DoCmd.OpenForm Me.OpenArgs
If not: Forms.item(Me.OpenArgs).SetFocus


Nov 13 '05 #5
Thank you for the information, let me give more detail. I have 6
different forms: frmStudent, frmRegistration, frmRecruitment, frmGrade,
frmPayment, frmPlacement. I have 6 icons on the right-side that you
can click on to go to each from. They could could click on the side
bar and go to any form they wish, but this is what the user is asking
for: if they are working on frmStudent and then they go to
frmPlacement instead of clicking on the icon they want to click on a
backarrow on frmPlacement and go back to frmStudent.

Nov 13 '05 #6
Thank you for the information, let me give more detail. I have 6
different forms: frmStudent, frmRegistration, frmRecruitment, frmGrade,
frmPayment, frmPlacement. I have 6 icons on the right-side that you
can click on to go to each from. They could could click on the side
bar and go to any form they wish, but this is what the user is asking
for: if they are working on frmStudent and then they go to
frmPlacement instead of clicking on the icon they want to click on a
backarrow on frmPlacement and go back to frmStudent.

Nov 13 '05 #7
rkc
Cheryl wrote:
Thank you for the information, let me give more detail. I have 6
different forms: frmStudent, frmRegistration, frmRecruitment, frmGrade,
frmPayment, frmPlacement. I have 6 icons on the right-side that you
can click on to go to each from. They could could click on the side
bar and go to any form they wish, but this is what the user is asking
for: if they are working on frmStudent and then they go to
frmPlacement instead of clicking on the icon they want to click on a
backarrow on frmPlacement and go back to frmStudent.

So all forms are opened from 6 icons that essentially make up a
switchboard form? In that case you could keep track of which
form was opened last using a local variable in the switchboard
form. Each time a form is opened pass the value of that variable
to the form being opened and then update the variable to the name
of the form being opened. If you check for a value in OpenArgs
each time a form is opened, you will be able to tell whether
your "back arrow" should be enabled. No value means there is
no form to go back to.


Nov 13 '05 #8
rkc
Cheryl wrote:
Thank you for the information, let me give more detail. I have 6
different forms: frmStudent, frmRegistration, frmRecruitment, frmGrade,
frmPayment, frmPlacement. I have 6 icons on the right-side that you
can click on to go to each from. They could could click on the side
bar and go to any form they wish, but this is what the user is asking
for: if they are working on frmStudent and then they go to
frmPlacement instead of clicking on the icon they want to click on a
backarrow on frmPlacement and go back to frmStudent.

So all forms are opened from 6 icons that essentially make up a
switchboard form? In that case you could keep track of which
form was opened last using a local variable in the switchboard
form. Each time a form is opened pass the value of that variable
to the form being opened and then update the variable to the name
of the form being opened. If you check for a value in OpenArgs
each time a form is opened, you will be able to tell whether
your "back arrow" should be enabled. No value means there is
no form to go back to.


Nov 13 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Ralph Freshour | last post by:
Is it possible to inhibit the browser Back/Fwd buttons via PHP? Thanks...
4
by: Dave Smithz | last post by:
Hi there, When filling out a web form on a php page that is submitted to a search which lists the results based on the criteria provided (in the form), all works fine and as expected. ...
5
by: Dani | last post by:
Hello everybody, I have some code that disables form elements on body load, but I notice when I hit the "back" button, I need to re-enable the form elements (that is done by clicking on a radial...
0
by: Cheryl | last post by:
How can I create a button that would take me back to the previous form not the previous record, but the previous form that I just moved from using VBA? Any sample code would be greatly appreciated.
4
by: Bratislav Jevtic | last post by:
hi, ASP.NET, framework 1.0, patch 2, Windows 2000 server is this possible: from server side to say "go back" to browser? ------------------- scenario: I've got some page with a list. When...
8
by: Galina | last post by:
Hello I have 6 dependent list boxes on my ASP page:  Faculty;  Lecturer;  Course;  Course occurrence;  Group;  Week commencing date. When faculty is selected, lists of lecturers and...
8
by: Tracey | last post by:
Hi, guys. My application requires functionalities like back and forward navigating button on winforms. And there are many forms linking each other. Each form has a pair of buttons of "Back" and...
59
by: Rico | last post by:
Hello, I have an application that I'm converting to Access 2003 and SQL Server 2005 Express. The application uses extensive use of DAO and the SEEK method on indexes. I'm having an issue when...
0
by: sweatha | last post by:
Hello Friends I have created the project with 2 forms. In the first form, I have 2 buttons. The first button has the backcolor as "fusia" by default. If I click the button means then backcolor of...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.