Results 1 to 2 of 2
  1. #1
    Derrick T. Davidson is offline Competent Performer
    Windows 8 Access 2010 64bit
    Join Date
    Mar 2013
    Posts
    142

    Modules in custom ribbon

    I have figured out how to include a macro in my custom ribbon "<button id="RunMyMacro2" label="Save and Close" onAction="Quit"/>" , however I am unsure if I can include a module I have the attached coded module in my database " Private Sub ExtBtn_Click()
    Dim Msg, Style, Title, Response, MyString

    Msg = "Are you sure you want to close the database?"
    Style = vbYesNo + vbCritical + vbDefaultButton2


    Title = "You Are Closing The Database"

    Response = MsgBox(Msg, Style, Title)
    If Response = vbYes Then
    MyString = "Yes"
    DoCmd.Quit acQuitSaveAll
    Else
    MyString = "No"
    DoCmd.CancelEvent
    End If
    End Sub"
    Can I include it in my code somehow, alternatively can I translate the module into a macro as the yes no cancel option is not included in the standard macro builder?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,899
    Site for custom ribbons http://www.accessribbon.de/en/?Welcome, provides sample databases. It helped me get my simple custom ribbon setup but I confess there is a lot in those examples that baffle me.

    This also helped http://office.microsoft.com/en-us/ac...010211415.aspx

    The best I could accomplish was to have a custom ribbon button call a macro and the macro runs VBA function. I think the VBA code must be Public function in a general module.

    Don't really understand your last question.
    Last edited by June7; 04-07-2013 at 10:08 PM.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Novice question XML Custom Ribbon
    By Derrick T. Davidson in forum Programming
    Replies: 2
    Last Post: 04-06-2013, 09:56 AM
  2. Create a custom ribbon
    By nick.h in forum Access
    Replies: 3
    Last Post: 03-15-2013, 02:12 PM
  3. custom Ribbon question
    By jscriptor09 in forum Access
    Replies: 0
    Last Post: 07-17-2012, 02:35 PM
  4. Custom Ribbon
    By nkuebelbeck in forum Programming
    Replies: 5
    Last Post: 08-25-2011, 11:55 AM
  5. Put an icon in a custom ribbon
    By ss3373 in forum Access
    Replies: 0
    Last Post: 06-21-2011, 05:52 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums