Link to home
Start Free TrialLog in
Avatar of Sonny G
Sonny G

asked on

IDBE Ribbon Creator does not have a way enter OnAction for dropdowns for Access

I am using a fully registered IDBE Ribbon Creator 2019 to generate a ribbon for a huge project.

I have run into a problem and need guidance.

I have dropdowns, but there is no OnAction control to fill in for each dropdown selection. How can I call procedures from the dropdowns? Look in the "control files" dropdown (Group grp1, Controls ddc_14). What code do I have to add in the XML to create an ONAction?

Look in RibbonXML.txt for thsi code:
<group id="grp1" autoScale="false" centerVertically="false" label="Data Entry" getVisible ="GetVisible" tag = "RibbonName:=;inMenu:=;CustomTagValue1:=;CustomTagValue2:=;CustomTagValue3:=;CustomPicture:=;CustomPicturePath:=" >
          <button id="btn4" size="normal" label="Project Data Entry" imageMso="HelpKeyboardShortcuts" tag="RibbonName:=ProjectMainRibbon;inMenu:=;CustomTagValue1:=;CustomTagValue2:=;CustomTagValue3:=;CustomPicture:=;CustomPicturePath:=" onAction="OnActionButton" getVisible="GetVisible" getEnabled="GetEnabled" />
          <dropDown id="ddc_14" label="Control Files" imageMso="DatabaseCopyDatabaseFile" onAction="OnActionDropDown" getVisible="GetVisible" getEnabled="GetEnabled" tag="RibbonName:=ProjectMainRibbon;inMenu:=;CustomTagValue1:=;CustomTagValue2:=;CustomTagValue3:=;DefaultValue:=;CustomPicture:=;CustomPicturePath:=">
             <item id="ddc_14Item0" label="Area Maintenance Engineer" />

<item id="ddc_14Item0" label="Area Maintenance Engineer" /> is the first dropdown that needs an OnAction {  the proc name to call is "AreaMaintenanceEngineer_CF_Data()   }


I am developing the ribbon is a sandbox on my workstation at home and want to transfer the new ribbon to the project in development whuch is on their network. These are my questions and assumptions:
  1. I assume that I copy the xml code from RibbonXML.txt into the sandbox Ribbon table USysRibbons
  2. I assume that I copy the three bas modules to the sandbox modules
  3. Where is the ribbon stored in GA for the dialog Select Ribbon: ? (ProjectMainRibbon)
  4. What do I do with Callbacks.txt? 
  5. Is there any other code to temporarily transfer to my client site?
  6. When my client gets a license (which is soon), what do I transfer from my sandbox to their installation? 
  7. How can I get back to the "normal" ribbon in the sandbox? Is there a way to switch from the custom ribbon to the new ribbon and back? Is my only choice to delete the custom ribbon name and then restart Access?
  8. Is there a programmatic way to have multiple custom ribbons and the "normal ribbon"? I would like to have the data entry screens have their own ribbon like in the "old days" of commandbars.

Attached is the sandbox access database  

RibbonXML.txtCallbacks.txtTestDatabase1.accdb

If you need more items, tell me where to find them and I'll send them.

Thanks, in advance!

Lenny Gray



ASKER CERTIFIED SOLUTION
Avatar of ste5an
ste5an
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Sonny G
Sonny G

ASKER

Thanks, Ste5an!

Some follow-up questions:

A.)  Your wrote:
Thus you need to evaluate the value in your action handler, which must have the following signature:

Public Sub DropDownOnAction(control As IRibbonControl,selectedId As String, selectedIndex As Integer)
End Sub

Open in new window

Does this proc only need to be processed once or once for each pulldown SeletedID?

B.) GA is the startup icon for IDBE. When I open the application, after I select the database, it asks which ribbon? I assume it must read each table in USysRibbons  but I am unsure

C.) Regarding item #7, I plan to have the Developer selection password-protected so that I can get into the application without the custom ribbon and do whatever tasks that I may need to do. So, I want to be able to have the custom ribbon "disappear" or the standard ribbon somehow appear also - just for me. When I finish my work, the custom ribbon would reappear. I was thinking that a form could be presented after password checking with the "standard ribbon" define for the ribbon of that "developer's" form. Does the standard ribbon have a "name" or is it a system default? Otherwise, I might have to build a custom ribbon that has the features of the "Standard Ribbon" in the Options -> customize ribbon, since we can have multiple ribbons as you validated in #8.

D.) Re: #6, I want the company to be licensed since I am simply a temporary contractor and do not want IDBE to lose a sale because all applications change over time.

BTW, you are brilliant!

Thanks!
A) This is the handler. The code should be in the callbacks.txt. Every time you change the drop-down, that handler is called. It is called once per change. (Untested) In the case of a multiselect it should be only called once.

B) Don't have it at hands. But affair you can select an existing one, which is read from USysRibbons of the loaded database or it is the name for a new one.

C) General development strategy:
You work always on your development database.
For deployment, you copy that version and adjust it. Like making it an .accde. Here you also activate your ribbion as default ribbon.
In the case of a replacement ribbon, I would use two ribbons. The replacement ribbon and the same without replacement (aka development ribbion). The code and the callbacks are not affected by this. Remove the development ribbion in the deployed version.
Avatar of Sonny G

ASKER

Thanks Ste5an for the guidance.

I have been developing software for over 51 years. I keep 'versioning' each new elevation to production. I take the production version and move it to development, increment the version number in development, pass it to UAT for approval and then elevate the approved UAT version to production. I stopped keeping "old" development versions to start upgrades/enhancements/fixes because the "development" version may not necessarily be the version to reach production - especially when there are multiple developers.
Doing Access since 97, my humble opinion:

Sometimes you creating the production/test version of an Access database includes irreversible steps. Like creating an .accde.
Thus the true source is in the development version, from which your have created your test and production version.
Obviously you need a way to keep track of that. I use source control (SVN) for the binary.

In the case of multiple developers, how do you keep track of the current state of work? There should be one development master where all the changes are merged into.
This development master copy is the true actual version, when tagged that a test/production version was derived from.
Avatar of Sonny G

ASKER

I understand your point and it is well-taken. It is probably my terminology rather than a disagreement in approach. Just like "sandbox". <grin>

Each developer would take on a change to elevate to UAT and then to Prod. No concurrent coding. All consecutive. Sometimes these changes are months apart. The Prod version is then turned into an .accde and retained as an .accdb.

The particular version number is stored in a table in the data database and in a table in the program database. These table values appear in the "About" form and at the top of the main form. It has two text constants: "Data Version xx.xx.xx" and the other is "Program Version: xx.xx.xx". These table values are also reported in automated emails to the development team when errors are raised. The error reporting email reports the data and program versions, system variables, the error number, error description and the offending procedure.

The approach may not be perfect but it has worked for me.

Thanks for your concern and your counsel!
Lenny

Avatar of Sonny G

ASKER

Hi Ste5an,

Sorry to be a pest.

Where is callbacks.txt stored? Does the text file have to be resident in the same directory as the accdb?

You made a mention that a change to code need to be in callbacks.txt also. This is my first Access ribbon and I am worried that I can trash all of my design work in the prototype.

I was in RibbonXML.txt and started to make the changes that you had suggested but I chickened-out. <blush>

Could I impose upon you to have you change RibbonXML.txt and callbacks.txt to implement just one OnAction callback code so that I can mimic it for all of the data files and reports that are in the drop downs? The OnAction for AreaMaintenanceEngineer is a proc: Public Sub AreaMaintenanceEngineer_CF_Data()

Thanks, in advance, for your patience.

Lenny