Link to home
Start Free TrialLog in
Avatar of cmccurdy
cmccurdyFlag for United States of America

asked on

Print records in Column - Array as record datasource

I need to fill out a preprinted deposit slip where the checks are printed in columns, i.e.

001   9999.99             004  6666.66           007 3333.33    
002   8888.88             005  5555.55
003   7777.77             006  4444.44

My data comes from a query containing <CheckNumber> and  <CheckAmount>

I  thought I could create a report, populate an array with the check info then use that array as the
report datasource but  haven't been able  to make that work.

Is there a better way to go about this?  I'm posting this as urgent because I'm at the customers site now and  I really need to solve this fast.


Avatar of thenelson
thenelson

In the report, go to File, Page Setup, the columns tab. Set up the columns as you need. Make sure can grow and can Think are off for the section.
can Think = can shink
Use the query as the recordsource of the report, then set up the report to use columns (down then across) - why do you think you should need to use an array?

Go into Page setup, then choose columns and it is fairly self evident how to set it up
<Off Topic>
Hey Nelson - good to see you :-)
Enjoy the break?
(Even I've had a week off lately - from EE anyway... yes some beer was involved :-S)
</Off Topic>
ASKER CERTIFIED SOLUTION
Avatar of Markus Fischer
Markus Fischer
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of cmccurdy

ASKER

Ok, I see  I wasn't specific enough about what I needed.  The preprinted deposit slips are designed for Quickbooks,  in addition to the checks I have the record the cash deposit and total as shown below.  Columns would work if it wasn't for the additional  info.  Also,  only the first 13 checks print on the front but the totals have to include all

Harfang, I'll try using unbound controls, that's sounds like what I was trying to do  with the array datasource, just a little more of a pain.

CASH       9.99
001    9999.99             004  6666.66           007 3333.33    
002    8888.88             005  5555.55                                                      Subtotal      99999.99
003    7777.77             006  4444.44                                                       Less Cash  99999.99

                                                                                                            TOTAL      99999.99              
                                   
Hello cmccurdy

The initial CASH and the TOTAL could be managed easily. The positioning of "Subtotal" and "Less Cash" is troublesome. I don't see how to handle them using a columnar report...

Access forms do not have control arrays, like VB, so you have to simulate them. Use names like txtCN0, txtCN2, ... txtCN12, and txtCA0, ... txtCA12. Used in a loop, you could then

    Set rec = CurrentDb.OpenRecordset("qselYourQueryHere")
    Do Until rec.EOF
        If rec.AbsolutePosition > 12 Then Exit Do
        Me("txtCN" & rec.AbsolutePosition) = rec!CheckNumber
        Me("txtCA" & rec.AbsolutePosition) = rec!CheckAmount
        rec.MoveNext
    Loop

But perhaps you knew that already.
(°v°)
Unbound controls filled using VBA worked.   A bit cumbersome, but workable give the short  amount of time I have to solve this one today.  Thanks for the help!
Well done! and have a nice week-end now!
(°v°)