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

Command Bars - Form Open Args 1

Status
Not open for further replies.

SeeThru

IS-IT--Management
May 2, 2002
585
GB
Hi All

Trying to open a form from a command bar, but using some sort of argument. OpenArgs does not seem to be available. I tried using the Tag property of the button, but cannot find a way to refer to it.

Can I either use openargs, or get the name of the calling button?

The only other option is to create three copeis of the form, but that seems....inelegant.

Thanks for any suggestions


SeeThru
Synergy Connections Ltd - Telemarketing Services
 
How are ya SeeThru . . .

You need to call your own function (with supplied arguement for [blue]OpenArgs[/blue]) in a module from the [blue]On Action[/blue] property of a button on the commandbar.

Special Note: Although you can edit the [blue]On Action[/blue] property of system supplied buttons, its better if you customize your own.

As an example, say you have the following function in a module in the modules window:
Code:
[blue]Public Function OpnFrm([b]Arg[/b] As String)
   DoCmd.OpenForm "[purple][B][I]FormName[/I][/B][/purple]", , , , , , [b]Arg[/b]
End Function[/blue]
To run the function, a call from the [blue]On Action[/blue] property of a command button would look like:
Code:
[blue]   =OpnFrm("[purple][B][I]OpenArgsTextHere[/I][/B][/purple]")[/blue]
[blue]Your Thoughts? . . .[/blue]

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top