Extensible Markup Language ( Customized Ribbon)

It seams like again , there is no way out here for adding the macro that run the forms & reports , what I'm trying to say is like below:

If I create a macro that open the sales order form and I call it " RunMyMacro" , then in XML it will look like below:

<button id="RunMyMacro" label="Run My Macro" onAction="MyMacro"/>

Now my question is suppose I have 100 forms in my application , then it means again that all those form must have macros like above if they are to be opened, for example:

(1) We use forms to open parameter queries  and
(2) Data capturing

Unless I'm missing the point here , is there way out to simply use one line command to open forms???????????


Regards

Chris
LVL 2
Hankwembo Christopher,FCCA,FZICA,CIA,MAAT,B.A.ScDirectorAsked:
Who is Participating?
 
Fabrice LambertConnect With a Mentor Fabrice LambertCommented:
Hi

To my knowledge, you only need one public procedure with the name you supplied in the XML.
And the procedure need to be in a standard module.

As far as openning forms, you have a couple of options available:
Use the openForm command:
docmd.OpenForm "formName", acNormal

Open in new window

Instanciate the form:
Dim frm As Form_frmUserForm
Set frm = new Form_userForm
frm.visible = true

Open in new window

0
 
Hankwembo Christopher,FCCA,FZICA,CIA,MAAT,B.A.ScDirectorAuthor Commented:
To my knowledge, you only need one public procedure with the name you supplied in the XML.
And the procedure need to be in a standard module.

But how are you going to call it in XML to be opening the required form without specifying  the parameter , please demonstrate how are doing it by using the following :

(1)  Sales Order form
(2)  General Journal form
(3) Payment form.
(4) Receipts form

Regards

Chris
0
 
Fabrice LambertFabrice LambertCommented:
You can put the form's name in a  string variable, variable's value depend on what you want to achieve.
0
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

 
Hankwembo Christopher,FCCA,FZICA,CIA,MAAT,B.A.ScDirectorAuthor Commented:
Exactly this what I thought , but I can do that ,and then call from XML on action, right! then what the second & third form?
0
 
John TsioumprisSoftware & Systems EngineerCommented:
You could create a method that reads the IRibbonControl Id and accordingly load the form you need...maybe you can do the mapping on a table and accordingly load the proper form...
0
 
Fabrice LambertFabrice LambertCommented:
You'll need to explain use exactly what you want to do. For now, your explanations are way too vague.

Plus, you can have more than one ribbon in the database, and each form can use a specific ribbon.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.