Grouping Form Fields on Continuous Form

Z

zaz

Hi,

I have a table which looks somewhat like this:
---------------------------
| Type | Name | Value |
---------------------------
| A | Ball | 1.00 |
| A | Cup | 2.00 |
| B | Fly | 0.50 |
(...and so on)

I want these displayed on a form, however, grouped by Type (similar to a
report), for example

Type: A
Ball [Textbox]
Cup [Textbox]
Type: B
Fly [Textbox]

Is such a thing possible?

The closest I can get is with multiple labels and conditional formatting.
Code seems to be of little use, as, if I try to set the Visible property of
the textbox, it applies to all textboxes on the form (or over the continuous
form).
Maybe there's something I missed? I wouldn't believe this to be exactly a
rare request...

Thanks a lot for reading, and many thanks in advance for any responses! :)
 
B

Beetle

I would say the problem is in your table, not your form. If one Type
(such as A) can have more than one item (ball, cup, whatever else),
then they should be in separate tables, related by, for example, a TypeID.

Furthermore, if an item can have more than one Type, then you have a
many-to-many relationship, in which case you need a third table.

Then you would set up a Form/subform for display & input.
 
Z

zaz

Hey Beetle,
Thanks a lot for the reply!

Yes, I can manipulate the data in the table - I just posted up the "raw"
data that I have. For example, it's quite easy to write up some code which
will pull out all the types and put them into a separate table.

The problem is that subforms cannot be placed in the Detail section of a
continuous form...

The method I'm currently using, puts an additional "dummy" Type record like
follows:
---------------------------
| Type | Name | Value |
---------------------------
| A | | |
| A | Ball | 1.00 |
| A | Cup | 2.00 |
| B | | |
| B | Fly | 0.50 |
(...and so on)

And then I can use conditional formatting to make the textbox appear to be
gray when Name is Null. The problem here is that the textbox is still there,
and doesn't exactly "look right".

Thanks again for reading and taking the time to respond :)
Do you have any further ideas?


Beetle said:
I would say the problem is in your table, not your form. If one Type
(such as A) can have more than one item (ball, cup, whatever else),
then they should be in separate tables, related by, for example, a TypeID.

Furthermore, if an item can have more than one Type, then you have a
many-to-many relationship, in which case you need a third table.

Then you would set up a Form/subform for display & input.
--
_________

Sean Bailey


zaz said:
Hi,

I have a table which looks somewhat like this:
---------------------------
| Type | Name | Value |
---------------------------
| A | Ball | 1.00 |
| A | Cup | 2.00 |
| B | Fly | 0.50 |
(...and so on)

I want these displayed on a form, however, grouped by Type (similar to a
report), for example

Type: A
Ball [Textbox]
Cup [Textbox]
Type: B
Fly [Textbox]

Is such a thing possible?

The closest I can get is with multiple labels and conditional formatting.
Code seems to be of little use, as, if I try to set the Visible property of
the textbox, it applies to all textboxes on the form (or over the continuous
form).
Maybe there's something I missed? I wouldn't believe this to be exactly a
rare request...

Thanks a lot for reading, and many thanks in advance for any responses! :)
 

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