PC Review


Reply
Thread Tools Rate Thread

Custom Ribbon and Reports

 
 
Joshann
Guest
Posts: n/a
 
      6th Apr 2010
I'm very new to Access 2007, and I'm trying to create a custom Ribbon.
Currently, I basically have the code for the sample in the USysRibbons table
like this:
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
<ribbon startFromScratch="true">
<tabs>
<tab id="dbCustomTab" label="A Custom Tab" visible="true">
<group id="dbCustomGroup" label="Reports">
</group>
</tab>
</tabs>
</ribbon>
</customUI>

I would like to know how to create buttons on the "Reports" group that will
open specific reports in my database. For example, I have a report called
rptDirectory. How do I make a button on the Ribbon that will open the
rptDirectory report?

I'm sure this is very elementary, but like I said, I'm new to Access 2007
and very new to trying to create a custom ribbon.

Thanks for any help you can provide.

 
Reply With Quote
 
 
 
 
Jeanette Cunningham
Guest
Posts: n/a
 
      7th Apr 2010
Here is some ribbon xml from one of my apps.
On the ribbon there is a button for Reports.
User clicks the button and the menu drops down with a list of reports to
select from.
Clicking a report on the list opens that report.


start of xml------------
<group id="grpCustReports" label="Reports" visible="true">

<menu id="mnuReports" size="large" label="Reports"
imageMso="ViewsReportView" itemSize="large">

<button
id="btnInvoiceJob"
label="Invoicing"
imageMso="CreateReport"
onAction="OnActionButton"
tag="Invoicing"
/>

<button
id="btnCurrentFortnightJob"
label="Job - Current Fortnight"
imageMso="CreateReport"
onAction="OnActionButton"
tag="Time with job details"
/>

<button
id="btnPreviousFortnightJob"
label="Job - Previous Fortnight"
imageMso="CreateReport"
onAction="OnActionButton"
tag="Time with job details"
/>

<button
id="btnCurrentFortnightHours"
label="Times - Current Fortnight"
imageMso="CreateReport"
onAction="OnActionButton"
tag="Time report"
/>

<button
id="btnPreviousFortnightHours"
label="Times - Previous Fortnight"
imageMso="CreateReport"
onAction="OnActionButton"
tag="Time report"
/>


<button
id="btnReportTask"
label="Tasks"
imageMso="CreateReport"
onAction="OnActionButton"
tag="task"
/>


<button
id="btnFix"
label="Database updates"
imageMso="CreateReport"
onAction="OnActionButton"
tag="Database updates"
/>

</menu>
</group>

end of xml------------


"Joshann" <(E-Mail Removed)> wrote in message
news:7D9B679C-139C-4EF1-AFC2-(E-Mail Removed)...
> I'm very new to Access 2007, and I'm trying to create a custom Ribbon.
> Currently, I basically have the code for the sample in the USysRibbons
> table
> like this:
> <customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
> <ribbon startFromScratch="true">
> <tabs>
> <tab id="dbCustomTab" label="A Custom Tab" visible="true">
> <group id="dbCustomGroup" label="Reports">
> </group>
> </tab>
> </tabs>
> </ribbon>
> </customUI>
>
> I would like to know how to create buttons on the "Reports" group that
> will
> open specific reports in my database. For example, I have a report called
> rptDirectory. How do I make a button on the Ribbon that will open the
> rptDirectory report?
>
> I'm sure this is very elementary, but like I said, I'm new to Access 2007
> and very new to trying to create a custom ribbon.
>
> Thanks for any help you can provide.
>



 
Reply With Quote
 
Mark Andrews
Guest
Posts: n/a
 
      7th Apr 2010
I have a few little articles on ribbons that I wrote when I started playing
with Access2007.
http://www.rptsoftware.com/help/micr...cess_examples/

It might help. You need to get that excel file so you can look up all the
icons and there names and you need to get the basics for the
basRibbonCallbacks routine. Buttons are pretty easy.

Here are some examples:
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui"
onLoad="onRibbonLoad">
<ribbon startFromScratch="true">
<tabs>
<tab id="tabHome" label="Home">
<group id="grpContacts" label="Contacts" visible="true">
<button id="ContactButton" label="Contacts"
imageMso="CreateTableTemplatesGallery" size="large"
onAction="OnActionButton" />
</group>
<group id="grpActivity" label="Activities" visible = "true">
<button id="ActivityButton" label="Activities" imageMso="FilePrepareMenu"
size="large" onAction="OnActionButton" />
</group>
<group id="grpEvents" label="Events" visible="true">
<button id="EventButton" label="Events" imageMso="AccessTableEvents"
size="large" onAction="OnActionButton" visible="true"/>
</group>
<group id="grpEmployees" label="Employees" visible="true">
<button id="EmployeeButton" label="Employees" imageMso="MeetingsWorkspace"
size="large" onAction="OnActionButton" />
</group>
<group id="grpReports" label="Reports" visible="true">
<button id="ReportButton" label="Reports" imageMso="PropertySheet"
size="large" onAction="OnActionButton" />
</group>
<group id="grpImport" label="Import Data" visible="true">
<button id="ImportButton" label="Import Data"
imageMso="SourceControlCheckIn" size="large" onAction="OnActionButton" />
</group>
<group id="grpAdmin" label="Options" visible="true">
<button id="OpvvvvvtionsButton" label="Setup/Options"
imageMso="OmsAccountSetup" size="normal" onAction="OnActionButton" />
<labelControl id="DateLabel" getLabel="getLabel" />
</group>
<group id="grpInfo" label="Info">
<button id="InfoButton" size="large" label="Info" imageMso="Info"
onAction="OnActionButton"/>
</group>
</tab>
</tabs>
</ribbon>
</customUI>

<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
<ribbon startFromScratch="true">
<tabs>
<tab id="MyReport" label="Report Print and View Options">

<group idMso="GroupPrintPreviewPrintAccess" />
<group idMso="GroupPageLayoutAccess" />
<group idMso="GroupZoom" />


<group icvd="ListCommands" label="Print">
<button idMso="FilePrintQuick" keytip="q" size="large"/>
<button idMso="PrintDialogAccess"
label="Print Dialog"
keytip="d" size="large"/>
</group>

<group id="ExportCmds" keytip="e" label="Data Export">
<button idMso="PublishToPdfOrEdoc" keytip="p" size="large"/>

<button id="CreateEmail" label="Email Report (PDF)"
imageMso="FileSendAsAttachment"
enabled="true" size="large"
onAction= "=MySend()"/>
</group>


<group idMso="GroupZoom"></group>

<group id="Exit" keytip="x" label="Exit">
<button idMso="PrintPreviewClose" keytip="c" size="large"/>
</group>

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



Here's a pretty simple basRibbonCallbacks routine:
Option Compare Database
Option Explicit

Public gobjRibbon As IRibbonUI

Public Sub OnRibbonLoad(ribbon As IRibbonUI)
'Callbackname in XML File "onLoad"

Set gobjRibbon = ribbon

End Sub

Public Sub OnActionButton(control As IRibbonControl)
'Callbackname in XML File "onAction"
On Error Resume Next
Select Case control.ID
Case "ContactButton"
Call OpenForm("frmContactList", 1)
Case "ActivityButton"
Call OpenForm("frmActivityList", 1)
Case "EventButton"
Call OpenForm("frmEventList", 1)
Case "EmployeeButton"
Call OpenForm("frmEmployeeList", 1)
Case "ReportButton"
'Call OpenForm("frmReports", 1)
MsgBox "No reports available at this time. Contact RPT Software
to get reports added to this database.", vbOKOnly, "Sorry - No Report
Available"
Case "ImportButton"
DoCmd.OpenForm "frmImport", , , , acFormEdit, acDialog
Case "OptionsButton"
DoCmd.OpenForm "frmOptions", , , , acFormEdit, acDialog
Case "InfoButton"
DoCmd.OpenForm "frmHelpAbout", , , , acFormEdit, acDialog
End Select
End Sub

Public Sub GetLabel(control As IRibbonControl, ByRef label)
'Callbackname in XML File "getLabel"

Select Case control.ID
Case "DateLabel"
label = Format(Now(), "dddd, mmm d, yyyy")

End Select
End Sub



"Joshann" <(E-Mail Removed)> wrote in message
news:7D9B679C-139C-4EF1-AFC2-(E-Mail Removed)...
> I'm very new to Access 2007, and I'm trying to create a custom Ribbon.
> Currently, I basically have the code for the sample in the USysRibbons
> table
> like this:
> <customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
> <ribbon startFromScratch="true">
> <tabs>
> <tab id="dbCustomTab" label="A Custom Tab" visible="true">
> <group id="dbCustomGroup" label="Reports">
> </group>
> </tab>
> </tabs>
> </ribbon>
> </customUI>
>
> I would like to know how to create buttons on the "Reports" group that
> will
> open specific reports in my database. For example, I have a report called
> rptDirectory. How do I make a button on the Ribbon that will open the
> rptDirectory report?
>
> I'm sure this is very elementary, but like I said, I'm new to Access 2007
> and very new to trying to create a custom ribbon.
>
> Thanks for any help you can provide.
>

 
Reply With Quote
 
Joshann
Guest
Posts: n/a
 
      7th Apr 2010
Thank you very much!

"Jeanette Cunningham" wrote:

> Here is some ribbon xml from one of my apps.
> On the ribbon there is a button for Reports.
> User clicks the button and the menu drops down with a list of reports to
> select from.
> Clicking a report on the list opens that report.
>
>
> start of xml------------
> <group id="grpCustReports" label="Reports" visible="true">
>
> <menu id="mnuReports" size="large" label="Reports"
> imageMso="ViewsReportView" itemSize="large">
>
> <button
> id="btnInvoiceJob"
> label="Invoicing"
> imageMso="CreateReport"
> onAction="OnActionButton"
> tag="Invoicing"
> />
>
> <button
> id="btnCurrentFortnightJob"
> label="Job - Current Fortnight"
> imageMso="CreateReport"
> onAction="OnActionButton"
> tag="Time with job details"
> />
>
> <button
> id="btnPreviousFortnightJob"
> label="Job - Previous Fortnight"
> imageMso="CreateReport"
> onAction="OnActionButton"
> tag="Time with job details"
> />
>
> <button
> id="btnCurrentFortnightHours"
> label="Times - Current Fortnight"
> imageMso="CreateReport"
> onAction="OnActionButton"
> tag="Time report"
> />
>
> <button
> id="btnPreviousFortnightHours"
> label="Times - Previous Fortnight"
> imageMso="CreateReport"
> onAction="OnActionButton"
> tag="Time report"
> />
>
>
> <button
> id="btnReportTask"
> label="Tasks"
> imageMso="CreateReport"
> onAction="OnActionButton"
> tag="task"
> />
>
>
> <button
> id="btnFix"
> label="Database updates"
> imageMso="CreateReport"
> onAction="OnActionButton"
> tag="Database updates"
> />
>
> </menu>
> </group>
>
> end of xml------------
>
>
> "Joshann" <(E-Mail Removed)> wrote in message
> news:7D9B679C-139C-4EF1-AFC2-(E-Mail Removed)...
> > I'm very new to Access 2007, and I'm trying to create a custom Ribbon.
> > Currently, I basically have the code for the sample in the USysRibbons
> > table
> > like this:
> > <customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
> > <ribbon startFromScratch="true">
> > <tabs>
> > <tab id="dbCustomTab" label="A Custom Tab" visible="true">
> > <group id="dbCustomGroup" label="Reports">
> > </group>
> > </tab>
> > </tabs>
> > </ribbon>
> > </customUI>
> >
> > I would like to know how to create buttons on the "Reports" group that
> > will
> > open specific reports in my database. For example, I have a report called
> > rptDirectory. How do I make a button on the Ribbon that will open the
> > rptDirectory report?
> >
> > I'm sure this is very elementary, but like I said, I'm new to Access 2007
> > and very new to trying to create a custom ribbon.
> >
> > Thanks for any help you can provide.
> >

>
>
> .
>

 
Reply With Quote
 
Joshann
Guest
Posts: n/a
 
      7th Apr 2010
Thank you also very much!

"Mark Andrews" wrote:

> I have a few little articles on ribbons that I wrote when I started playing
> with Access2007.
> http://www.rptsoftware.com/help/micr...cess_examples/
>
> It might help. You need to get that excel file so you can look up all the
> icons and there names and you need to get the basics for the
> basRibbonCallbacks routine. Buttons are pretty easy.
>
> Here are some examples:
> <customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui"
> onLoad="onRibbonLoad">
> <ribbon startFromScratch="true">
> <tabs>
> <tab id="tabHome" label="Home">
> <group id="grpContacts" label="Contacts" visible="true">
> <button id="ContactButton" label="Contacts"
> imageMso="CreateTableTemplatesGallery" size="large"
> onAction="OnActionButton" />
> </group>
> <group id="grpActivity" label="Activities" visible = "true">
> <button id="ActivityButton" label="Activities" imageMso="FilePrepareMenu"
> size="large" onAction="OnActionButton" />
> </group>
> <group id="grpEvents" label="Events" visible="true">
> <button id="EventButton" label="Events" imageMso="AccessTableEvents"
> size="large" onAction="OnActionButton" visible="true"/>
> </group>
> <group id="grpEmployees" label="Employees" visible="true">
> <button id="EmployeeButton" label="Employees" imageMso="MeetingsWorkspace"
> size="large" onAction="OnActionButton" />
> </group>
> <group id="grpReports" label="Reports" visible="true">
> <button id="ReportButton" label="Reports" imageMso="PropertySheet"
> size="large" onAction="OnActionButton" />
> </group>
> <group id="grpImport" label="Import Data" visible="true">
> <button id="ImportButton" label="Import Data"
> imageMso="SourceControlCheckIn" size="large" onAction="OnActionButton" />
> </group>
> <group id="grpAdmin" label="Options" visible="true">
> <button id="OpvvvvvtionsButton" label="Setup/Options"
> imageMso="OmsAccountSetup" size="normal" onAction="OnActionButton" />
> <labelControl id="DateLabel" getLabel="getLabel" />
> </group>
> <group id="grpInfo" label="Info">
> <button id="InfoButton" size="large" label="Info" imageMso="Info"
> onAction="OnActionButton"/>
> </group>
> </tab>
> </tabs>
> </ribbon>
> </customUI>
>
> <customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
> <ribbon startFromScratch="true">
> <tabs>
> <tab id="MyReport" label="Report Print and View Options">
>
> <group idMso="GroupPrintPreviewPrintAccess" />
> <group idMso="GroupPageLayoutAccess" />
> <group idMso="GroupZoom" />
>
>
> <group icvd="ListCommands" label="Print">
> <button idMso="FilePrintQuick" keytip="q" size="large"/>
> <button idMso="PrintDialogAccess"
> label="Print Dialog"
> keytip="d" size="large"/>
> </group>
>
> <group id="ExportCmds" keytip="e" label="Data Export">
> <button idMso="PublishToPdfOrEdoc" keytip="p" size="large"/>
>
> <button id="CreateEmail" label="Email Report (PDF)"
> imageMso="FileSendAsAttachment"
> enabled="true" size="large"
> onAction= "=MySend()"/>
> </group>
>
>
> <group idMso="GroupZoom"></group>
>
> <group id="Exit" keytip="x" label="Exit">
> <button idMso="PrintPreviewClose" keytip="c" size="large"/>
> </group>
>
> </tab>
> </tabs>
> </ribbon>
> </customUI>
>
>
>
> Here's a pretty simple basRibbonCallbacks routine:
> Option Compare Database
> Option Explicit
>
> Public gobjRibbon As IRibbonUI
>
> Public Sub OnRibbonLoad(ribbon As IRibbonUI)
> 'Callbackname in XML File "onLoad"
>
> Set gobjRibbon = ribbon
>
> End Sub
>
> Public Sub OnActionButton(control As IRibbonControl)
> 'Callbackname in XML File "onAction"
> On Error Resume Next
> Select Case control.ID
> Case "ContactButton"
> Call OpenForm("frmContactList", 1)
> Case "ActivityButton"
> Call OpenForm("frmActivityList", 1)
> Case "EventButton"
> Call OpenForm("frmEventList", 1)
> Case "EmployeeButton"
> Call OpenForm("frmEmployeeList", 1)
> Case "ReportButton"
> 'Call OpenForm("frmReports", 1)
> MsgBox "No reports available at this time. Contact RPT Software
> to get reports added to this database.", vbOKOnly, "Sorry - No Report
> Available"
> Case "ImportButton"
> DoCmd.OpenForm "frmImport", , , , acFormEdit, acDialog
> Case "OptionsButton"
> DoCmd.OpenForm "frmOptions", , , , acFormEdit, acDialog
> Case "InfoButton"
> DoCmd.OpenForm "frmHelpAbout", , , , acFormEdit, acDialog
> End Select
> End Sub
>
> Public Sub GetLabel(control As IRibbonControl, ByRef label)
> 'Callbackname in XML File "getLabel"
>
> Select Case control.ID
> Case "DateLabel"
> label = Format(Now(), "dddd, mmm d, yyyy")
>
> End Select
> End Sub
>
>
>
> "Joshann" <(E-Mail Removed)> wrote in message
> news:7D9B679C-139C-4EF1-AFC2-(E-Mail Removed)...
> > I'm very new to Access 2007, and I'm trying to create a custom Ribbon.
> > Currently, I basically have the code for the sample in the USysRibbons
> > table
> > like this:
> > <customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
> > <ribbon startFromScratch="true">
> > <tabs>
> > <tab id="dbCustomTab" label="A Custom Tab" visible="true">
> > <group id="dbCustomGroup" label="Reports">
> > </group>
> > </tab>
> > </tabs>
> > </ribbon>
> > </customUI>
> >
> > I would like to know how to create buttons on the "Reports" group that
> > will
> > open specific reports in my database. For example, I have a report called
> > rptDirectory. How do I make a button on the Ribbon that will open the
> > rptDirectory report?
> >
> > I'm sure this is very elementary, but like I said, I'm new to Access 2007
> > and very new to trying to create a custom ribbon.
> >
> > Thanks for any help you can provide.
> >

> .
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom button image not loading on custom ribbon Joshua Microsoft Excel Programming 1 16th Apr 2010 05:33 PM
Custom Ribbon @@Flyboy Microsoft Access VBA Modules 1 20th Apr 2008 10:24 AM
Custom Ribbon @@Flyboy Microsoft Access VBA Modules 0 20th Apr 2008 10:18 AM
Custom menus don't appear under custom ribbon tab Misbah Microsoft Excel Programming 2 15th Apr 2008 01:29 AM
Opening a report from the ribbon doesn't show it's custom ribbon =?Utf-8?B?QXJpYW4gR2VlcnRzZW1h?= Microsoft Access Reports 0 20th Aug 2007 11:34 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:37 AM.