displaying fields

R

Rani

Hi guys

I have a table with about 20 fields

What I would like to do is to give the user the ability to choose the
contract type and then according to his selection to display the appropriate
fields.



AKA if the user selected 1 fields A,B,C,D will be displayed if the user
selected 2 then fields E,F,G,H will be displayed



Thanks for your help.



Ciao
 
T

tom

Using a form, you can set each field's visible property accordingly... e.g.
set all fields Visible property to NO, when you open the form it is blank...
except for several option buttons... press an option button and it sets
certain fields's Visible property to Yes, or No depending on which one you
press... etc.

HTH.

Tom.
 
M

Mike Painter

Rani said:
Hi guys

I have a table with about 20 fields

What I would like to do is to give the user the ability to choose the
contract type and then according to his selection to display the appropriate
fields.



AKA if the user selected 1 fields A,B,C,D will be displayed if the user
selected 2 then fields E,F,G,H will be displayed

Set the visible property of the fields to false.
In the afterupdate event for your type:
If Type = 1 then
Me!A.visible = True
 
J

John Vinson

Hi guys

I have a table with about 20 fields

What I would like to do is to give the user the ability to choose the
contract type and then according to his selection to display the appropriate
fields.



AKA if the user selected 1 fields A,B,C,D will be displayed if the user
selected 2 then fields E,F,G,H will be displayed

This sounds VERY strongly like you have an improperly normalized
table. If you have fields A, B, C, D containing the same type of data
as those in E, F, G, H, differing only by a contract type, a better
design would be to have TWO tables in a one to many relationship; the
second table would have six fields - a link to your current table; a
ContractType field; and these four fields.

You can do what you ask... but it's BAD DESIGN and will get you in
real trouble (for instance when you add another contract type)!
 
R

Rani

can I do the same with a sub form ?
it seems more logical to open to sub forms and then control witch one will
be displayed
 
M

Mike Painter

Yes you can and you could do it with tabbed pages and a couple other ways.

Using a subform will require some sort of a relationship between what is on
the main form and what is on the subform.
 

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