subform format

R

Roger

I was wondering if it was possible to arrange the records in a subform so that multiple records can be displayed on the same row.

Eg.
currently it's:
record 1
record 2
record 3
record 4
....

I would like:
record 1 record 2 record 3
record 4 record 5 record 6

I tried just copying those records in Design View and pasting them beside the original, but I get the same records.
Eg. record 1 record 1
record 2 record 2

Is there something to put into the properties box or a code for that?

Thanks
 
J

Jim Shaw

My approach to this in the past was to write a VB module. Call the module
passing it a RecordsetClone, and the names of the form controls to receive
the record data. The module can process the cloned recordset , moving to
the next record as necessary, without messing with your position in the
form's data source recordset.

-Jim

Roger said:
I was wondering if it was possible to arrange the records in a subform so
that multiple records can be displayed on the same row.
Eg.
currently it's:
record 1
record 2
record 3
record 4
...

I would like:
record 1 record 2 record 3
record 4 record 5 record 6

I tried just copying those records in Design View and pasting them beside
the original, but I get the same records.
 
R

Roger

Thanks Jim. But I'm not understanding what you're saying. So I create a copy of the records, and then let the module move them around? I don't understand how that will change the placement of the text boxes in the subform
 
J

Jim Shaw

Roger;

Essentially, you have two ways to go with this, depending upon how your form
is designed. Given that you can show n-records in a row, I assume that the
records do not contain many columns (fields).

Method 1: Write a module to prepass the table, reading groups of n-records,
assembling them into new individual rows, n-records wide, and writing them
out to a temporary table. Use the temporary table as the record source for
your form. If your form works in continuous record mode, this is the way to
go. You'll need to find a place to run this procedure before the records
are displayed. Perhaps in the OnClick procedure of the command button that
opens the form.

Method 2: Assuming that your form works in current record mode (or at least
looks like it does)...
Do not bind your form to a record source, leave it unbound. Create your own
record navigation command buttons. Write a subroutine that reads the next
n-records (or the previous n-records) and loads them into your form text
boxes depending upon which navigation button is clicked. Run these routines
from the OnClick event of the navigation buttons. Hide the nav buttons
provided by Access.

I guess using a recordsetClone might not be useful in the above methods. If
you wanted to dynamically add text box controls to your form to accommodate
the records, the recordsetClone approach would work. But that would be a
third method which is more complex than the above two.

I know you were hoping for an easy setting way to accomplish this, but I'm
not aware of any such thing. However, these design approaches will get you
where you need to go.

-Jim


Roger said:
Thanks Jim. But I'm not understanding what you're saying. So I create a
copy of the records, and then let the module move them around? I don't
understand how that will change the placement of the text boxes in the
subform.
 
R

Roger

Thanks Jim! I'll give it a try. I might be back in a couple of days if I still can't get it
Happy Holidays!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top