Open one Form from Another and transfer Data

Open one Form from Another and transfer Data

Passing Form Values

A common requirement is to pass values from one form to another. In these videos I demonstrate some problems you might face, and demonstrate a good and robust way of doing it.

…         ..         ..            ..        ..          ..           ..     ..  ..         … 

Open One Form From Another

Open One Form From Another

Video 1 (3:15)

have used the technique shown here, for many years. I find it is very flexible, also, quick and easy to copy from one Form to another.

In the sample database I use this code:-

Private Sub btnOpenForm2_Click()
Dim strFrmName As String
strFrmName = "Form2"
    
    DoCmd.OpenForm strFrmName
        With Forms(strFrmName)
           '.btnOnForm2.Enabled = True
           '.fSetUp ("Sample Parameter")
           '.Caption = "I CAN CHANGE THE CAPTION"
        End With

End Sub

… to open the form and directly and access the properties of the command button.

I have deliberately left items (the commented out lines) in the code so you can get an idea of what’s possible by using this method.

For example this line here ‘.fSetUp  calls the function “fSetUp” which is a public function within the form you are opening.  If you un comment that line it will calls a function and you can see how it works.

This is a very powerful way of controlling what happens when you open another form….

You can also provide function parameters which provide one method of Passing values through to the form you are opening…

Video 1 (3:15)

Play Video

Related Links:-

… …

Form Load, Activate, Open, Issue 

Form Load, Activate, Open, Issue 

Video 2  (3:58)

Video 2  (3:58)

Play Video

More Info on Form Load, Activate, Open:-

… …

Form Values passed to Controls 

Form Values passed to Controls 

Video 3 (1:22)

Video 3  (1:22)

Play Video

More Info on Form Values passed to Controls

… …

MORE - On the Form Load Issue 

The Form Load Issue  

Video 4 (2:00) Approx!

This video, from my YouTube Playlist:- Object Oriented – Nifty Access explores creating a Class Module to use with Allen Browne’s Calendar Form… However Allen Browne’s Calendar Form can be set up and used as is, if you follow the instructions on his website HERE:- Popup Calendar http://allenbrowne.com/ser-51.html

Video 4 (2:00) Approx!

Play Video

… …

PopUp Form - Pass Data Back

PopUp Form - Pass Data Back

Video 4 (7:57)

In this video I demonstrate calling a pop-up form, extracting a row number from a subform in datasheet view on the form. I demonstrate how to extract text from the same subform. I suggest t’s a good idea to start using the “Value” of property. I explained how to pass the value by making a copy of the textbox. I passed that to the Pop-Up form. Then, add a custom property and pass the data into the custom property. I use the “With” – “End With” Block to bracket the code that operates on the form.

Video 4 (7:57)

Play Video

More Info on PopUp Form - Pass Data Back

… …

Call Called Class

Call Called Class

Video 5 (9:44)

This was one of my early videos on “Call Calling” Class. As with most projects your code starts out with the goal of solving one particular problem. As you progress, you realise your idea can be applied more generally. I recently updated this Class Module . It was originally based on the Microsoft active X calendar control.

See YouTube playlist here:- Object Oriented – Nifty Access

Video 5 (9:44)

Play Video

More Info on - Call Called Class

… …

Leave a Comment