Results 1 to 7 of 7
  1. #1
    Star Lounger
    Join Date
    Jan 2001
    Posts
    50
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Printing Choices in a Combo Box (2000)

    Someone has come to me with the following question that I'm not sure how to answer. Let's say you have a fieldname that is a lookup field/combo box. Is there a way to print a report that shows the choices in the combo box? (rather than just the one that is chosen for that one record).

    -Kelley

  2. #2
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Printing Choices in a Combo Box (2000)

    Hi,
    I would have said that the simplest way would be to create a query based on the rowsource of the combobox. You can then create a report based on that or simply use the query output depending on your needs.
    Hope that helps.
    Regards,
    Rory

    Microsoft MVP - Excel

  3. #3
    Star Lounger
    Join Date
    Jan 2001
    Posts
    50
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Printing Choices in a Combo Box (2000)

    Thanks for the suggestion. How do I create a query based on the rowsource?

  4. #4
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Printing Choices in a Combo Box (2000)

    Open the properties for the field/combo and copy whatever is in the rowsource box. Then create a new blank query (i.e. don't add any tables) and switch to SQL view. Paste in your copied rowsource and away you go.
    Any problems please post back.
    Regards,
    Rory

    Microsoft MVP - Excel

  5. #5
    Star Lounger
    Join Date
    Jan 2001
    Posts
    50
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Printing Choices in a Combo Box (2000)

    Rory -- Would it matter if the choices in the rowsource box were typed in rather than pulling from another table? When I switch to SQL view the word SELECT; there by default. I am not sure what the syntax should be in there when I paste the info from the rowsource in there (which is "MR.";"MRS.";"MS.") as an example. It seemed that no matter where I paste it, I get some sort of error about syntax or arguments required.

    -Kelley

  6. #6
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Printing Choices in a Combo Box (2000)

    Oh sorry - I assumed it was a lookup against one or more tables. If it's a value list then whatever is typed in there is your set of possibilities. You can simply look at the list (not likely to be long or else a table would be a better way of doing it). Is it just one combobox the user is interested in or some sort of database analysis of all lookup/comboboxes? If it's the latter you will need code to do it.
    Regards,
    Rory

    Microsoft MVP - Excel

  7. #7
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Printing Choices in a Combo Box (2000)

    Kelley,

    have a look at this post. Maybe it can help you.
    If you want the the data in a list change the line
    ComboToLine = ComboToLine & Me.Combo0.ItemData(x) & ", "
    to
    ComboToLine = ComboToLine & Me.Combo0.ItemData(x) & vbCrLf
    Francois

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •