Keep Track of the Last Form

Keep Track of the Last Form

In your MDI application, you might have many child forms and need a form to go back to the form thatcalled it. In each child form, declare this variable:

 Public Callingform As Form

Before calling a form, set CallingForm to the form that is calling it so that the form being called canremember which form called it. Use this call to call a form:

 ShowForm frmNextForm, Me

frmNextForm is the form that you’re calling, and ShowForm is this Global Procedure (declared in a BASfile):

 Sub ShowForm(frmFormToShow As Form, _        frmFrom As Form)        frmFrom.Hide        frmFormToShow.Show        Set frmFormToShow.Callingform = _                frmFromEnd Sub

To close a form and go back to the form that called it, use this call:

 ExitForm Callingform, Me

ExitForm is this global procedure:

 Sub ExitForm(Callingform As Form, _        ThisForm As Form)        Unload ThisForm        Callingform.ShowEnd Sub

Use this procedure for all child forms except when you need to make the call from the main MDI form. Inthis case, use this call:

 ShowChild frmChildfrmChild is the MDIChild form you're calling, and ShowChild is defined in the MDI form:Private Sub ShowChild(frm As Form)        frm.Show        Set frm.Callingform = frmMainEnd Sub

It’s a good idea to call procedures to do these tasks because you might want to put extra processing in theseprocedures. Note you should have error-handing routines as well in the procedures.

Share the Post:
Heading photo, Metadata.

What is Metadata?

What is metadata? Well, It’s an odd concept to wrap your head around. Metadata is essentially the secondary layer of data that tracks details about the “regular” data. The regular

XDR solutions

The Benefits of Using XDR Solutions

Cybercriminals constantly adapt their strategies, developing newer, more powerful, and intelligent ways to attack your network. Since security professionals must innovate as well, more conventional endpoint detection solutions have evolved

AI is revolutionizing fraud detection

How AI is Revolutionizing Fraud Detection

Artificial intelligence – commonly known as AI – means a form of technology with multiple uses. As a result, it has become extremely valuable to a number of businesses across

AI innovation

Companies Leading AI Innovation in 2023

Artificial intelligence (AI) has been transforming industries and revolutionizing business operations. AI’s potential to enhance efficiency and productivity has become crucial to many businesses. As we move into 2023, several

data fivetran pricing

Fivetran Pricing Explained

One of the biggest trends of the 21st century is the massive surge in analytics. Analytics is the process of utilizing data to drive future decision-making. With so much of

kubernetes logging

Kubernetes Logging: What You Need to Know

Kubernetes from Google is one of the most popular open-source and free container management solutions made to make managing and deploying applications easier. It has a solid architecture that makes