0
votes

In my USysRibbons table I have this RibbonXML below which have a labelControl that I would like to alter using the onload event "BAMPEAMain_onLoad"

When I open the database, MsAcces display the following message ...Cannot run the marco or callback function 'BAMPEAMain_onLoad. Make sure the macro or function exists and takes the correct parameters.

What's wrong with the BAMPEAMain_onLoad

Public Sub BAMPEAMain_onLoad(ribbon As IRibbonUI)
'
' Code for onLoad callback. Ribbon control customUI

MsgBox "Hello " '& dhGetUserName 'use the record dhGetUserName function to get the current user logged ID.
.
.
.

RibbonXML

<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="BAMPEAMain_onLoad">
<ribbon startFromScratch="true">
    <tabs>
    <tab idMso="TabFile" visible="false" />
    <tab idMso="TabHome" visible="false" />
    <tab idMso="TabCreate" visible="false" />
    <tab idMso="TabExternalData" visible="false" />
    <tab idMso="TabDatabaseTools" visible="false" />
    <tab idMso="TabSourceControl" visible="false" />
    <tab idMso="TabAddIns" visible="true" />
    <tab id="BAMPEA" label="BAMPEA" visible="true">
<group id="Connect" label="Connect" visible="true">
      <comboBox id="SelectSites" label="Sites" visible="true" onChange="SelectSites_onChange"/>
      <comboBox id="SelectDB" label="Select DB" visible="true" onChange="SelectDB_onChange"/>
     <labelControl id="CurrentUserId" label="Bonjour ! - " visible="true"/>
     <button id="ExitApp" imageMso="ShapeLightningBolt" label="Exit" visible="true" onAction="ExitApp_onAction"/>
     <button id="BAMPEAHelp" imageMso="WorkflowPending" visible="true" onAction="BAMPEAHelp_onAction"/>
</group ></tab >
</tabs> 
</ribbon>
<backstage>
    <tab idMso="TabInfo" visible="true"/>
    <button idMso="FileSave" visible="false"/>
    <button idMso="SaveObjectAs" visible="false"/>
    <button idMso="FileSaveAsCurrentFileFormat" visible="false"/>
    <button idMso="FileOpen" visible="false"/>
    <button idMso="FileCloseDatabase" visible="false"/>
    <tab idMso="TabRecent" visible="false"/>
    <tab idMso="TabNew" visible="false"/>
    <tab idMso="TabPrint" visible="false"/>
    <tab idMso="TabShare" visible="false"/>
<tab id="customTab" label="Custom Tab"/>
    <tab idMso="TabHelp" visible="false"/>
    <button idMso="ApplicationOptionsDialog" visible="false"/>
    <button idMso="FileExit" visible="false"/>
</backstage>
</customUI>
1

1 Answers

0
votes

When MsAccess display the following message ...Cannot run the marco or callback function 'BAMPEAMain_onLoad. it's because MS access can't find the public sub BAMPEAMain_onLoad in your vba module or there is a typo in your module.

Problem fixed.