To determine which form is displayed after the current form is closed

exaccess

Registered User.
Local time
Today, 05:26
Joined
Apr 21, 2013
Messages
287
Hello Ladies and Gentlemen,
I have a series of forms that become current in a certain order. For example a menu form comes up. This is followed by a search form where the user gives search parameters. Then appears the results list. If the user wants a detail form comes after that, etc. Now when the user closes the last form I want the form before that one to show up and when he closes that one the one before that and so on. That is I am going to use the close button to go back to the previous step. How can I do this.
 
How does this fail to occur now? For instance, if I open Form A, and then I open form B, form B will be on top of form A. Then, if I close form B, form A will appear again, which sounds like your desired outcome, and which is how Access--and any Windows application--is already designed to work.

How is it that your system doesn't already behave that way?
 
How does this fail to occur now? For instance, if I open Form A, and then I open form B, form B will be on top of form A. Then, if I close form B, form A will appear again, which sounds like your desired outcome, and which is how Access--and any Windows application--is already designed to work.

How is it that your system doesn't already behave that way?

It should normally behave that way, but it does not. That is what I am trying to figure out. Between two forms due to programming reasons the control is passed to modules, but then it comes back to the form again. For example the execution of the code below passes the control to a module and the open form called ActiveMembersFm disappears from the window. The code is in the form that disappears and should normally be in the hierrachical squence. But then how can I run the code wthout causing that to happen?

Code:
Private Sub Sbox_AfterUpdate()
    Dim ForName As String
    Dim ParName As String
    Dim QryName As String
    Dim I As Integer
    ParName = Me.Form.Name           'ActiveMembersFm
    
    I = Me.CurrentRecord
    G_MemID = Me.MemID
 
    Debug.Print "Me.CurrentRecord=  "; Me.CurrentRecord
    Select Case Me.Sbox.Value
        Case "Member"
            ForName = "NewMemberEntryFm"
            QryName = "ActiveMembersQy"
            Call SboxSelectForm(ForName, ParName, QryName)
        Case "Details Data"
            ForName = "Members_DetailsFm"
            QryName = "ActiveMembersQy"
            Call SboxSelectForm(ForName, ParName, QryName)
    End Select
End Sub
 
Hi All
I think the key to this is the SboxSelectionForm method.
Either scrap this and open the new form using code directly - using the openargs method to pass a reference to the form opening the new form. I think searching - cascading forms may find this :confused:

Alternately modify the method to pass the reference of the current form to the new form..

HTH

T
 
Hi All
I think the key to this is the SboxSelectionForm method.
Either scrap this and open the new form using code directly - using the openargs method to pass a reference to the form opening the new form. I think searching - cascading forms may find this :confused:

Alternately modify the method to pass the reference of the current form to the new form..

HTH

T

Hi Tim,
The reason for using the SBoxSelectionForm method is that the same code is used with different parameters namely ParName the calling form, ForName the called form and the QryName the query of the recordsource of the called form. This code is called and many times and it is centralized in a module for easy maintenance and standardization. But I shall try your proposals and come back.
 
Well I moved some of the code that you mentioned and things got settled. I do not know which code was causing that. But my question remains: Does anybody know of a parameter or a possibility as it is done with the tabs of a form to define the order of appearance of forms, so that in case the problem comes up again we can make use of this facility?
 

Users who are viewing this thread

Back
Top Bottom