Results 1 to 10 of 10
  1. #1
    kchm2000 is offline Novice
    Windows 10 Access 2016
    Join Date
    Mar 2017
    Posts
    16

    Using a combobox to affect a query that launches into a report

    Hi,

    I have created a form called report launcher in the following database Country Form v04042017.zip. I am trying to use the form to select the particular country so that the report will generate records linked to the country. Would it be possible for the report to directly also export to excel? Could somebody help with this? thanks in advance

  2. #2
    andy49's Avatar
    andy49 is offline VIP
    Windows 10 Access 2007
    Join Date
    Nov 2016
    Location
    London
    Posts
    1,051
    Better surely to export data to excel. It will look less pretty but you'll be able to use the data and even reformat it from inside excel


    Sent from my iPhone using Tapatalk

  3. #3
    kchm2000 is offline Novice
    Windows 10 Access 2016
    Join Date
    Mar 2017
    Posts
    16
    Thanks, but do you know how to use access forms to launch an export to excel command? My question is for how to launch an export to excel command.

  4. #4
    andy49's Avatar
    andy49 is offline VIP
    Windows 10 Access 2007
    Join Date
    Nov 2016
    Location
    London
    Posts
    1,051

    Using a combobox to affect a query that launches into a report

    Yes

    On the on update event

    Add vba code which runs the query

    Check out the transfer spreadsheet function.


    Sent from my iPhone using Tapatalk

  5. #5
    kchm2000 is offline Novice
    Windows 10 Access 2016
    Join Date
    Mar 2017
    Posts
    16
    Would someone be able to use the database i uploaded to create an example to help me please?

  6. #6
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    For the report, add a Where condition for each of the buttons - where CountryCode=Forms![Report Launcher]!Combo14



    For exporting to Excel, add a new button and use the TransferSpreadsheet function

  7. #7
    kchm2000 is offline Novice
    Windows 10 Access 2016
    Join Date
    Mar 2017
    Posts
    16
    Would it be possible for you to help me with the VBA (working example) that is necessary? I am really new to ms access and programming in general. A working example would be big help. thanks

  8. #8
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    You don't need VBA for this, you are already using macros and can continue with that if you aren't comfortable with VBA.

  9. #9
    kchm2000 is offline Novice
    Windows 10 Access 2016
    Join Date
    Mar 2017
    Posts
    16
    By the way whats the difference between VBA and macros. Aren't Macros some kind of coding as well? In addition how do i add in the where clause for "where CountryCode=Forms![Report Launcher]!Combo1" Could you point me to which part of the property sheet?

  10. #10
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    VBA is code, macros are commands. If you go to one of those macros that you use you will see how to enter the where condition, plus other parameters you could utilize. Take a tutorial on macros before even considering using VBA.

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

Similar Threads

  1. Replies: 5
    Last Post: 07-07-2016, 03:57 PM
  2. Replies: 1
    Last Post: 05-13-2015, 01:14 PM
  3. Setting columns to affect only details
    By trpatrick in forum Reports
    Replies: 1
    Last Post: 03-09-2015, 08:04 AM
  4. Replies: 8
    Last Post: 04-03-2012, 12:00 PM
  5. Replies: 3
    Last Post: 08-02-2011, 09:25 PM

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