473,769 Members | 6,583 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 14128
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.setfocu s'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.setfocu s'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.O penArgs).SetFoc us


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.O penArgs).SetFoc us


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
6628
by: Ralph Freshour | last post by:
Is it possible to inhibit the browser Back/Fwd buttons via PHP? Thanks...
4
5751
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. However, when I press the back button to amend the form all of the search criteria data has gone and I have to fill it all out again if I want to do a similar search which is frustrating. (This does not actually happen in Firefox browser but most of my...
5
2444
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 button). Is there any way I can keep the form for disabling every time a user hits the back button and "remember" what elements should be enabled? I was thinking maybe utilizing some referrer thing, but I'm not that good with JS yet. Thanks...
0
323
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
3258
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 one clicks some button goes to "detail" page - for to add/update data. That form may have number of postbacks. On
8
2583
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 courses are populated. When course is selected, lists of occurrences, groups and
8
6527
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 "Forward "How can I implement the back and forward procedure to make them work ? Is there anyone has the same experience like that ? Thanks
59
7521
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 the recordset opens a table. When I write Set rst = db.OpenRecordset("MyTable",dbOpenTable, dbReadOnly) I get an error. I believe it's invalid operation or invalid parameter, I'm
0
1137
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 the button should change into red color. Thats why I have given the coding as Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click If Button1.BackColor = Drawing.Color.Fuchsia Then ...
0
9590
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9424
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10051
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10000
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7413
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6675
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3571
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.