Access Stuff From Other Forms

By | 2002-06-01

This just shows how to access CommandButton’s, Label’s etc.. from another Command or label. So when you click Form1’s Command, you can actually be clicking Form2’s command. Very useful for shortcuts.

Original Author: SeeD

Inputs

1. make 2 forms
2. make a command button on each form

Returns

returns the action of the other command button

Code

'So you have your 2 forms? Good.
'Use the code below in the specified
'areas...

  Private Sub Command1_Click()
    Form2.Command1.Value = True
  End Sub

'That goes in form1's command button. Just add an action to the command button on form 2 to work it!

Author: dwirch

Derek Wirch is a seasoned IT professional with an impressive career dating back to 1986. He brings a wealth of knowledge and hands-on experience that is invaluable to those embarking on their journey in the tech industry.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.