Results 1 to 6 of 6
  1. #1
    Waagemartin is offline Novice
    Windows 7 32bit Access 2002
    Join Date
    Jun 2015
    Location
    South Dakota
    Posts
    5

    Question Creating a drop-down to generate report

    Long story short, I couldn't find a better way to organize my data for an ongoing history project and so am trying my hand at Access.


    I'm fairly knowledgeable when it comes to computers, just not Access - go easy on me...

    So, I've got an Access 2000 database built, with 3 main tables - have relationships set up and which look to be working fine (two of the tables each link to one field in the third, main, table).

    What I want to do now, is to be able to have a combo box - whether on my existing form (or likely a separate one), that I can just pick the town I want, then the database would return all the records in the main table for that town, and put that into a report.

    I'm sure there are tons of tutorial pages out there in cyberspace covering the steps involved in this process, but without the proper terminology, I don't know where to begin searching. If someone can rephrase or expand on what I want to do such that I can both get a better idea of what I need to do as well as being able to search the interwebs for answers in a more intelligent way, it would be appreciated.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,527
    In your form (continuous form) of records, put an unbound combo in the header. (this one is named cboClient)
    This has a list of items to pick, in the AFTERUPDATE event put this code:

    Code:
    if isnull(cboClient) then
       me.FilterOn = false
    else
      me.filter = "[ClientID]=" & cboClient
      me.FilterOn = true
    endif

  3. #3
    nick404's Avatar
    nick404 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    May 2015
    Location
    Wisconsin
    Posts
    352
    As far as creating that report goes, I would just add a 'generate report' (or w/e text you want) button somewhere that will make the report for you. Behind the button's "On Click" event put this code:
    Code:
    DoCmd.OpenReport "YourRptName", acViewReport
    Assuming you have the report made up this will open it for you.
    Alternatively you could save the report to a macro, and on the button's on click select run macro and select the macro.
    I think dynamically generating the report using VB on the fly would be a lot more work than what it is worth. Using the VB to open a previously made report off of a form is more logical.

  4. #4
    Waagemartin is offline Novice
    Windows 7 32bit Access 2002
    Join Date
    Jun 2015
    Location
    South Dakota
    Posts
    5
    I guess Access is proving to be a LOT more complicated than I thought it was.
    So I have to take a step back and figure out what to do.

  5. #5
    Waagemartin is offline Novice
    Windows 7 32bit Access 2002
    Join Date
    Jun 2015
    Location
    South Dakota
    Posts
    5
    For now, I'm just shelving Access and going through the records by hand in Excel - already have 1500 done and 2400+ to go.

  6. #6
    nick404's Avatar
    nick404 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    May 2015
    Location
    Wisconsin
    Posts
    352
    ouch

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

Similar Threads

  1. Replies: 8
    Last Post: 12-07-2013, 05:22 PM
  2. Replies: 1
    Last Post: 11-30-2013, 03:43 AM
  3. Creating dynamic drop down list
    By SltPhx in forum Access
    Replies: 3
    Last Post: 07-29-2013, 10:17 AM
  4. Replies: 19
    Last Post: 05-12-2009, 02:59 PM
  5. How about creating a drop down menu in a report?
    By beastmaster in forum Access
    Replies: 2
    Last Post: 12-29-2005, 01:01 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