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

Passing Tag From MenuBar Button

Status
Not open for further replies.

ind

Programmer
Mar 9, 2000
121
US
I have created a custom menubar for an application that I will be using in the near future. I need to pass the Tag Property of the commandbar button to a form I created to print various reports. How can I accomplish this?????
 
I don't know a solution to directly pass the button tag property.

But when you set the button Tag property, modify too the OnAction property: call a fonction with a parameter that is the same value than tag.

Example:
You set button tag to "MyTag"
Set the OnAction to =Menu_OnClickButton("MyTag")

Add this function into a module :
Public Function Menu_OnClickButton(ByVal Tag As String)
'Send on click event to form
set frm = GetForm() 'Get here your form
frm.OnClick( Tag ) 'Add the function OnClick into your form
End Function
 
This line of code is throwing me for a loop....

frm.OnClick( Tag ) 'Add the function OnClick into your form

What does this mean??????

Thanks
 
In your form you have to add a procedure like:


public Sub OnClick(Tag as string)
'Button treatment here
if tag = "MyTag" then
...
end if
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top