Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to link popup menu items to diffrent forms and pass them data?

Status
Not open for further replies.

Edward07

Programmer
Apr 13, 2007
49
NL
I created a popup menu and it has few items on it. The popup menu get displaied when i right click listview row.Now i want to diffrent forms open when i select diffrent items from the menu. could and one show me how i can link forms to menu items?

Furthermore, i want some how pass listview item to those form but don't know how that can be done. For example i want to pass column 6th data to form1 while entire row is selected.I be happy if some one show me how this can done.Thanks
 
This isn't difficult. Just put FormName.Show in the menu item's event handler.

To pass data to a form, the easiest way is to set up a property on the form and then set the property from another form. The easiest way to set up a property for this purpose is as a public variable. So, I have two forms: Form1 and Form2. I want to pass data from form1 to form2 when I show form2. Here's the code:
Code:
in Form2
Option Explicit
Public LastName as String

in Form1

Private Sub mnuOpenForm2_Click
form2.LastName = "Rodes"
Form2.Show
End Sub
Now you will find that the LastName variable is available in Form2.

HTH

Bob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top