Results 1 to 4 of 4
  1. #1
    argsemapp is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2013
    Posts
    18

    Creating textboxes for reports on the fly

    I am working on a form that allows the user to select several alloys to display chemical compositions for a report. I am able to successfully get the alloys I need onto a (global) recordset.

    The 'Chemical Composition' recordset itself has over 30 fields (one for each element on the periodic table, ie Iron, Zinc, Gold, etc.), each field is either a '0' or has some value (bc it's an element in the formula of the alloy). Every alloy can have a drastically different chemical composition.

    Basically I need to find a programmatic way to get my report to "go through the recordset display a 2xN grid for each alloy ('N' being the number of elements in the alloy), with each 'column' that prints to have the Element on top then the value for that element below it. I.E.:



    Code:
    REPORT
    
              [Fe]  [Cr]
    Alloy 1   50%   50%
    
              [Ag]  [Cr]  [Co]
    Alloy 2   25%   50%   25%
    
    ...
    
    Alloy N
    Thank you for any tips/hints/previous examples you may be able to throw my way

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    I do something like that by saving data to a temp table. Review http://forums.aspfree.com/microsoft-...ry-322123.html

    Yours would be structured like:
    Alloy E1Name E1Pct E2Name E2Pct E3Name E3Pct
    1 Fe 50 Cr 50
    2 Ag 25 Cr 50 Co 25
    3
    4

    How many maximum elements could there possibly be for each alloy?


    Another option might be to concatenate the data to a single string for each alloy.
    Review http://allenbrowne.com/func-concat.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
    argsemapp is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2013
    Posts
    18
    June7-

    GREAT suggestion! this takes care of my main issue which was trying to format my report around my recordset.

    I think the 'wost' alloy we have has 9 separate elements. But alloys can have anywhere from 3-9 so you can see my problem of how to format this report..

    I think I should be able to set up a blank 2x9 grid made of textboxes in my report, and then loop my (transposed) recordset for each element until it reaches the end.... then would it be possible to somehow get rid of the unwanted blank entries? Is there a setting in Access to SetXthColumnLineThickness = 0?

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    What do you mean by 'get rid of'? The empty fields in table will be blank textboxes on report. I wouldn't bother with trying to adjust the report structure.
    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.

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

Similar Threads

  1. Problem Creating Excel Chart TextBoxes in Access 2010
    By JonMulder in forum Programming
    Replies: 5
    Last Post: 03-24-2013, 08:16 PM
  2. Creating Graphs in Reports
    By katejohnson in forum Reports
    Replies: 3
    Last Post: 10-18-2012, 12:41 PM
  3. Reports and Textboxes
    By jmenz in forum Reports
    Replies: 1
    Last Post: 03-25-2012, 08:38 PM
  4. Creating reports
    By d_evo in forum Reports
    Replies: 1
    Last Post: 02-29-2012, 02:31 PM
  5. Creating multiple reports from one Query
    By Mike Cooper in forum Reports
    Replies: 5
    Last Post: 04-24-2006, 05:00 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