Idea 2 – Using the QuickAccessToolbar

Use The QuickAccessToolBar for shortcuts to the employees most used forms.

The Ribbon menu allows three things that could give more room to display forms with a large amount of data. I.e. The ribbon can be minimised. The QuickAccessToolbar shortcuts can be customised to be below the Title Bar. The shortcuts in the ribbon can be added to the QuickAccessToolbar.

So how could I achieve this? Then I thought the number of shortcuts on the QuickAccessToolbar needs to be controlled by both the Employee and the Administrator. Easy. Create a table with fields that hold the Employee’s code, The text to show in the Customise Quick Access dropdown, The path to the icon displayed, Whether the shortcut can be added as the application is opened and whether the Customise dropdown shows it ticked (and if not ticked don’t show the icon).

I then created a form to be used by the Administrator to control this. Ticked a few boxes, and placed the following code into the Init of the main form.

If !Used("QuickAccess") && Control Table
	Use QuickAccess In 0 Alias QuickAccess
EndIf

Select QuickAccess
Set Filter To QuickAccess.Employee = "PH" && Alter to use employee logged in

Local lnCount
lnCount = 1
Scan
	If lnCount > 20
		Exit
	EndIf
	If QuickAccess.Include

&&			lcCmd = "Thisform.Ribbon.QuickAccessToolbar._Button" + Transform(lnCount) + ".Caption = " + '"' + Alltrim(QuickAccess.Descript) + '"'
&&			lcCmd = "Thisform.Ribbon.QuickAccessToolbar.Controls(" + Transform(lnCount) + ").Title = " + '"' + Alltrim(QuickAccess.Descript) + '"'
&&			&lcCmd
&&			ThisForm.Ribbon.QuickAccessToolbar.Controls(lnCount).SetPicture(Alltrim(QuickAccess.Picture))

		With Thisform.Ribbon.QuickAccessToolbar.Controls(lnCount)
			.SetPicture(Alltrim(QuickAccess.Picture))
			.Caption = Alltrim(QuickAccess.Descript)
			.ToolTip = Alltrim(QuickAccess.ToolTip)
		EndWith
		lnCount = lnCount + 1
	EndIf
EndScan

I would like to amend this to add controls to the Quick Access bar at run time and also Tick or Untick the customise prompts.

(Work in Progress)