Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

VBA combo box

  • 24-11-2009 07:04PM
    #1
    Registered Users, Registered Users 2 Posts: 4,337 ✭✭✭


    I have a VBA app that was put together by someone else. There is a combo box in it that when you right-click on it it gives you a command that exports the contents of the combo box to Excel.
    I want to know how do I get at the code which produces this? I presume it is some kind of macro.
    Thank you.


Comments

  • Closed Accounts Posts: 317 ✭✭tiptap


    lukin wrote: »
    I have a VBA app that was put together by someone else. There is a combo box in it that when you right-click on it it gives you a command that exports the contents of the combo box to Excel.
    I want to know how do I get at the code which produces this? I presume it is some kind of macro.
    Thank you.

    Hi

    What version of access is it.
    If it's 2007, if you go into the database, and click on the file, then access options, then customize, you should see somewhere in there that the other developer probably created a custom menu.

    Also, if you do a ctrl and F to do a search. If you search in the entire solution for the name of the dropdown box, you should see the code where he is exporting to excel.

    Cheers


  • Registered Users, Registered Users 2 Posts: 4,337 ✭✭✭lukin


    It is Access 2002.


  • Moderators, Politics Moderators, Paid Member Posts: 44,334 Mod ✭✭✭✭Seth Brundle


    go into the forms design
    right click on the combo and choose properties
    select the events tab
    Select the event handler that corresponds with the export (possibly before update or after update). If it gives the name of somehting in there then it is macro based but if it says "[Event Procedure]" then its code based (which may well be passwrod protected). Clicking the ellipsis should open the code for you.

    Is this a business critical application? If so then make sure that you have backed up the database and also make sure that you know what you are doing (which (with no offence intended) it sounds like you don't). Any code will need to be compiled after you change it.

    Also, bear in mind that if (in the off chance) this was developed by another company for you, do you own the application or is there already a support agreement in place?

    Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/ .



  • Registered Users, Registered Users 2 Posts: 4,337 ✭✭✭lukin


    Silly me, I found the code by doing a search for the message box that comes up when you select the menu item ("Are you sure you want to export?").
    I still don't know where it is called from but it doesn't matter.


Advertisement