Results 1 to 7 of 7
  1. #1
    Counterpoint13 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    May 2013
    Posts
    5

    Question First Post! On Creating Conditional Reports (No, Not Conditional Formatting)

    Hi,



    As said, this is my first post on this forum! Greetings everyone! : )

    Okay, so here's the issue: I am looking for a way create a report that is conditionally filled with data.

    For example imagine I have a table Customers and it has three columns: QuantityAdults, QuantityChild, and QuantityInfant.

    I want to display in a report the quantity of each in a single line, like so:

    Number of People: 1 Adult, 2 Child, and 1 Infant.

    However, I do not want something like 0 Child or 0 Adult to appear, I only want to include the quantity if it is 1 or greater.

    So for example if in my Customers table: QuantityAdults = 1, QuantityChild = 2, and QuantityInfant = 0 then my report would display on a single line:

    Passengers: 1 Adult, 2 Child

    I am new to Access, so please keep that in mind. One more thing: Please try to avoid using code unless it is the simplest solution, that is what I am looking for a simple that-makes-sense solution!

    Thank you all!


    Best wishes,

    Counterpoint

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,543
    Are the values in the fields numeric (eg: 1, 2, 0) or are they alpha-numeric (eg: 1 Adult, 2 Child, 0 Infant)
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    Counterpoint13 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    May 2013
    Posts
    5
    Hi!

    I would much prefer them to be numeric as that would be easier to handle (for example preform math on, etcetera).

    Thank you for the quick reply! : )

    I am sure this is possible, I just have not been able to locate a good solution!


    Thank you,

    Counterpoint

  4. #4
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,543
    As with many things, there is more than one way of doing things. The attached db illistrates three ways. They require the table data to be numeric.
    Post back if you need any explanation.
    Attached Files Attached Files
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  5. #5
    Counterpoint13 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    May 2013
    Posts
    5

    Question Sorry, I Should Have Been More Specific

    Hello again!

    The pictures below outline what I am looking for more specifically. I checked out Bob's attachment, but all three of them did not visually look like what I was looking for.

    My goal is to combine table data to create a report that is formatted like this:

    ID: 4
    Number of People: 1 Adult, 2 Child

    Instead of listing out the data under each respective column, I want to combine such data in the format as specified above.

    Please view the pictures below, as they explain specifically what I am looking for.

    Please do not hesitate to ask for clarification, I would be glad to provide such!

    Thank you all! And thank you Bob in particular for your efforts! : )


    Best regards,

    Counterpoint




    Click image for larger version. 

Name:	Table.png 
Views:	17 
Size:	62.4 KB 
ID:	12226
    Click image for larger version. 

Name:	Form.png 
Views:	17 
Size:	79.8 KB 
ID:	12223

    Click image for larger version. 

Name:	Report.png 
Views:	17 
Size:	64.8 KB 
ID:	12225

  6. #6
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,543
    Perhaps the attached db is what you want?
    Attached Files Attached Files
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  7. #7
    Counterpoint13 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    May 2013
    Posts
    5
    Bob's solution did accomplish what I was trying to do, however I was able to find another solution without using purely code. An additional solution to creating is located at: http://www.utteraccess.com/forum/Cre...-t2003783.html

    Thank you to all who helped! Sorry for the long wait time before posting again, but I do believe thanks are in order!


    Cordially,

    Counterpoint

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

Similar Threads

  1. Conditional Formatting for Reports
    By Harley Guy in forum Reports
    Replies: 1
    Last Post: 04-04-2013, 11:57 AM
  2. Replies: 5
    Last Post: 03-14-2013, 01:52 PM
  3. conditional formatting
    By michele in forum Forms
    Replies: 6
    Last Post: 02-01-2012, 01:16 PM
  4. Conditional formatting on reports
    By JenEveAle in forum Reports
    Replies: 2
    Last Post: 12-20-2011, 10:53 PM
  5. Conditional Formatting
    By pkstormy in forum Code Repository
    Replies: 0
    Last Post: 08-30-2010, 09:31 PM

Tags for this Thread

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