MS-Access Ribbon Subsequent Refresh Issues

V

Virtualware

Scenario: 3 forms which are called one after the other. I setup a header
with 3 labels which reads data from a query to populate the labels.

Issue: from Form 1, I Open form 2 and the header info matches Form 1. If I
open Form 2 then From form 2 I open Form 3 then the header info of form 3
matches Form 1 header info. Then I close Form 3 and close form2 and I'm back
to form1 then I choose a different record and open form2: Now Header info
does not match form1 and if I open form 3 then header info matches form1.
Key hint: If I only open Form 1 and form 2 the header info will be always
right in both forms.

I create a work around which is shown below. however I want to find out if
there is proper and more effective way of handling the ribbon refresh as I
will be using queries to populate the ribbons.

By using the different callback object and function I was able to refresh
the header info.

Any help will be much appreciated.

Thank you very much.


'Module : mdRibbonCode
Public gobjRibbon As IRibbonUI
Public gobjRibbon1 As IRibbonUI

Public Sub CallbackOnLoad(ribbon As IRibbonUI)
' Cache a copy RibbonUI
Set gobjRibbon = ribbon
End Sub

Public Sub CallbackOnLoad1(ribbon As IRibbonUI)
' Cache a copy RibbonUI
Set gobjRibbon1 = ribbon
End Sub

'Ribbon Code Form 1
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui"
onLoad="CallbackOnLoad1" >
<ribbon startFromScratch="true">
<tabs>
<tab id="tabInfo" label="Administración">
<group id="grpInfo" label="Datos de Ingreso" tag="1">
<labelControl id="lblPaciente" getLabel="VGetLabel" />
<labelControl id="lblDoctor" getLabel="VGetLabel" />
<labelControl id="lblFIngreso" getLabel="VGetLabel" />

<dialogBoxLauncher>
<button id="myLauncher1" screentip="Information"
supertip= "Muestra Ficha de admisión del pacienteRibbon Datenbank"
onAction="VRibbonButtonClick" />
</dialogBoxLauncher>
</group>
<group id="grpReportes" label="Reportes" >
<button id="btnAIngreso" size="normal" label="Autorización
de Ingreso" onAction="VRibbonButtonClick" imageMso="GroupCreateReports"/>
<button id="btnAIngresoInformado" size="normal" label="Autorización de
Ingreso Informado" onAction="VRibbonButtonClick"
imageMso="GroupCreateReports"/>
<button id="btnACirugia" size="normal" label="Autorización
de Cirugía" onAction="VRibbonButtonClick" imageMso="GroupCreateReports"/>
<button id="btnAEgresoV" size="normal" label="Autorización de Egreso
Voluntario" onAction="VRibbonButtonClick" imageMso="GroupCreateReports"/>
</group>
<group id="grpIM" label="Hoja del Médico" >
<button id="btnIM" size="large" label="Indicaciones"
onAction="VRibbonButtonClick" imageMso="FileServerLinkTables"/>
</group>
<group id="grpInsumos" label="Insumos" >
<button id="btnInsumos" size="large" label="Agregar"
onAction="VRibbonButtonClick" imageMso="PropertySheet"/>
<button id="btnVerInsumos" size="large" label="Consultar"
onAction="VRibbonButtonClick" imageMso="DefaultView"/>
</group>
<group id="grpFinanzas" label="Finanzas" >
<button id="btnBalance" size="large" label="Estado de
Cuenta" onAction="VRibbonButtonClick" imageMso="FormattingUnique"/>
<button id="btnFacturar" size="large" label="Facturar"
onAction="VRibbonButtonClick" imageMso="ApplyCurrencyFormat"/>
</group>
<group id="FgrpCloseForm" label="Comandos de Pantalla"
visible="true">
<button id="btnFormClose" size="large" label="Cerrar
Ventana" imageMso="PrintPreviewClose" onAction="VRibbonButtonClick"/>
</group>
</tab>
</tabs>
</ribbon>
</customUI>

'Ribbon Code in form 2
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui"
onLoad="CallbackOnLoad1" >
<ribbon startFromScratch="true">
<tabs>
<tab id="tabInfo" label="Administración">
<group id="grpInfo" label="Datos de Ingreso" tag="1">
<labelControl id="lblPaciente" getLabel="VGetLabel" />
<labelControl id="lblDoctor" getLabel="VGetLabel" />
<labelControl id="lblFIngreso" getLabel="VGetLabel" />

<dialogBoxLauncher>
<button id="myLauncher1" screentip="Information"
supertip= "Muestra Ficha de admisión del pacienteRibbon Datenbank"
onAction="VRibbonButtonClick" />
</dialogBoxLauncher>
</group>
<group id="grpReportes" label="Reportes" >
<button id="btnAIngreso" size="normal" label="Autorización
de Ingreso" onAction="VRibbonButtonClick" imageMso="GroupCreateReports"/>
<button id="btnAIngresoInformado" size="normal" label="Autorización de
Ingreso Informado" onAction="VRibbonButtonClick"
imageMso="GroupCreateReports"/>
<button id="btnACirugia" size="normal" label="Autorización
de Cirugía" onAction="VRibbonButtonClick" imageMso="GroupCreateReports"/>
<button id="btnAEgresoV" size="normal" label="Autorización de Egreso
Voluntario" onAction="VRibbonButtonClick" imageMso="GroupCreateReports"/>
</group>
<group id="grpIM" label="Hoja del Médico" >
<button id="btnIM" size="large" label="Indicaciones"
onAction="VRibbonButtonClick" imageMso="FileServerLinkTables"/>
</group>
<group id="grpInsumos" label="Insumos" >
<button id="btnInsumos" size="large" label="Agregar"
onAction="VRibbonButtonClick" imageMso="PropertySheet"/>
<button id="btnVerInsumos" size="large" label="Consultar"
onAction="VRibbonButtonClick" imageMso="DefaultView"/>
</group>
<group id="grpFinanzas" label="Finanzas" >
<button id="btnBalance" size="large" label="Estado de
Cuenta" onAction="VRibbonButtonClick" imageMso="FormattingUnique"/>
<button id="btnFacturar" size="large" label="Facturar"
onAction="VRibbonButtonClick" imageMso="ApplyCurrencyFormat"/>
</group>
<group id="FgrpCloseForm" label="Comandos de Pantalla"
visible="true">
<button id="btnFormClose" size="large" label="Cerrar
Ventana" imageMso="PrintPreviewClose" onAction="VRibbonButtonClick"/>
</group>
</tab>
</tabs>
</ribbon>
</customUI>

'Ribbon Code Form 3
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui"
onLoad="CallbackOnLoad">
<ribbon startFromScratch="true">
<tabs>
<tab id="tabForm" label="Start">
<group id="grpInfo" label="Datos de Ingreso" tag="1">
<labelControl id="lblPaciente" getLabel="VGetLabel" />
<labelControl id="lblDoctor" getLabel="VGetLabel" />
<labelControl id="lblFIngreso" getLabel="VGetLabel" />

<dialogBoxLauncher>
<button id="myLauncher1" screentip="Information"
supertip= "Muestra Ficha de admisión del pacienteRibbon Datenbank"
onAction="VRibbonButtonClick" />
</dialogBoxLauncher>
</group>
<group id="grpECuenta" label="Estado de Cuenta" >
<labelControl id="lblHospitalizacion" getLabel="GetLabel" />
<labelControl id="lblMedicinas" getLabel="GetLabel" />
<labelControl id="lblMaterial" getLabel="GetLabel" />
<separator id="mySeparator1" />
<labelControl id="lblAnticipo" getLabel="GetLabel" />
<labelControl id="lblAbonos" getLabel="GetLabel" />
<labelControl id="lblSaldo" getLabel="GetLabel" />

</group>
<group id="FgrpCloseForm" label="Cerrar" visible="true">
<button id="btnFormClose" size="large"
imageMso="PrintPreviewClose" onAction="VRibbonButtonClick"/>
</group>

</tab>
</tabs>
</ribbon>
</customUI>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top