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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing a Parameter from the Switchboard

Status
Not open for further replies.

mns117

Programmer
Apr 8, 2002
32
0
0
US
Hi,

I am using the switchboard as my main menu system. I have a subswitchboard that people will go to run reports. From this menu, I want them to choose the report that they want to view. However, instead of going to the report, its going to go to a form which is going to make them specify some criteria. Is there a way to send a value from the switchboard, to the form, in order to capture which button they clicked? Each button is going to the same form.

Oh, if the best way to do this is through the openargs, how can I edit the onclick event on the switchboard?

Thanks

Mike
 
declare the form as an object in the switch board and then create a property on the form. When the user makes a selection, you can pass that selection to the property of the form like this:

formname.propertyname = UserSelection

Then you can open the form and read from the property to get the value passed from the switchboard.

Hope this helps. You might want to look in help about properties and object declarations.
 
How do i capture which switchboard button was pressed. It doesn't look like I can add an onlclick to any of the switchboard buttons???
 
Just create the property on the 2nd form, like I mentioned before, then in the onclick event, populate that property.

Are you familiar with instantiation of class objects? If not let us know.
 
I am not familiar with the instantiation of class objects.
 
Ok. Basically at the top where you would normally declare global variables, you will put something like this...

Code:
public myForm = FormName

where FormName is whatever the name of your form is.

Then just before you use the form's property, you will want to put code like this...

Code:
set myForm = New FormName

Then when you want to use it, like populating a property, you can do something like this...

Code:
myForm.PropertyName = WhatEverValue

you must create a property on the FormName though for that to work so you can assign whatever info to it...

Let me know if that is not clear.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top