Results 1 to 12 of 12
  1. #1
    Ayiramala is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Dec 2014
    Location
    Kerala, India
    Posts
    74

    Show records from three combo boxes simultaneously

    Hi,
    Sorry to bother you again, but just got a problem I can't solve.


    On this form I have three identical Combo Boxes which show the names of the classes in our school. They are just three copies of the same combo box. What I want is this: I choose three different classes from these three boxes. Then I want a button at the bottom which when pressed, should show the records of these three classes separately. Preferably, as three columns.
    I have made the Combo Boxes, but am stuck at the button to perform these actions.
    How do we do it?
    Any help is greatly appreciated.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,642
    Show these records where? What do you mean by 'separately'? What do you mean by 'as columns'? Is there only one field in the table that the filter criteria will be applied to? This is applying multiple parameters to the same field. Often this is accomplished with a multi-select listbox. VBA code constructs a filter string that is applied to the form or report filter property. Review: http://allenbrowne.com/ser-50.html
    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.

  3. #3
    Ayiramala is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Dec 2014
    Location
    Kerala, India
    Posts
    74
    Sorry for being so vague.
    I want the records to show in a report. In Microsoft Word we format a page into two or three columns. Similarly, I want the report to show the names as three columns (separately). When I press the button, it should generate the report with the names from the first combo box on the left, the second in the middle, and the third on the right.
    Yes, there is only one field in the table that the filter will be applied to.
    Hope that helps.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,642
    So you pick 3 classes and want student names to list as 3 columns.

    Sounds like need to do a multi-column report with group breaks on the classes. Multi-columns are set in report design view for the Detail section. Page Setup tab on ribbon.

    Use code like in the referenced link to construct filter criteria and apply to the report when opening.

    DoCmd.OpenReport "report name", , , strWHERE
    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.

  5. #5
    Ayiramala is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Dec 2014
    Location
    Kerala, India
    Posts
    74
    Quote Originally Posted by June7 View Post
    So you pick 3 classes and want student names to list as 3 columns.

    Sounds like need to do a multi-column report with group breaks on the classes. Multi-columns are set in report design view for the Detail section. Page Setup tab on ribbon.

    Use code like in the referenced link to construct filter criteria and apply to the report when opening.

    DoCmd.OpenReport "report name", , , strWHERE
    Thanks. I'll do as instructed and post back.

  6. #6
    Ayiramala is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Dec 2014
    Location
    Kerala, India
    Posts
    74
    I am very sorry to say that I couldn't get it done. tried the code in the link several times but just couldn't get it right. if I do not select any class from the list box I get a report with all the names as a single list, which includes all the classes. If I select a class from the list box a blank report is shown. Just cannot get it right..

  7. #7
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,642
    If you want to provide db for analysis, follow instructions at bottom of my post.
    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.

  8. #8
    Ayiramala is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Dec 2014
    Location
    Kerala, India
    Posts
    74
    I think after several attempts of trial and error I got it working
    Thanks for your help. May I ask just one last question? Is it possible to concatenate two fields that belong to two union queries in a single field which is on a report?

  9. #9
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,642
    How are two union queries part of the report?

    Fields that are in report RecordSource can be concatenated, regardless of how they got there.
    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.

  10. #10
    Ayiramala is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Dec 2014
    Location
    Kerala, India
    Posts
    74
    We have these two union queries, each with a certain field. Can we concantenate these two fields and show it in a report?

  11. #11
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,642
    As I said, if the fields are in the report RecordSource ...

    Do these union queries have relationship - can they be joined?

    Can't be more specific because I don't know your data.
    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.

  12. #12
    Ayiramala is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Dec 2014
    Location
    Kerala, India
    Posts
    74
    Please ignore the last post. I was able to get it done. No problems.
    Thanks a lot for helping.

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

Similar Threads

  1. Replies: 24
    Last Post: 07-23-2014, 11:53 AM
  2. Replies: 6
    Last Post: 02-21-2014, 04:58 PM
  3. Replies: 4
    Last Post: 10-06-2012, 11:57 AM
  4. Replies: 4
    Last Post: 07-13-2012, 12:47 PM
  5. Replies: 1
    Last Post: 07-30-2011, 03:21 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