Hiding fields

peterengland

New member
Local time
Today, 10:16
Joined
Apr 15, 2005
Messages
7
Hi can you help. I am developing an access database for an alarm installation company. The database will consist of five tables (stock, supplier, customer, stocksupplier) all with forms.

The customer table holds data for three customer types business, private, caravan. Each customer type has different data stored for it for example the business customer has more than one contact address whereas the private has one.

The problems is on the form I do not want all the fields present as this would look a mess. Is there a way of clicking a radio button or choosing from a drop down list that would make the fields relevant to that customer type appear or grey out the fields that are not needed.

I would appreciate any help as the only alternative I can come up with is have them all on one form. I do not want separate tables as this would complicate the design. I hope this makes sense and thank you in anticipation
Kind Regards :) :)
Peter
 
Disable

The easiest way would be to disable the fields you don't need.
You could put this code behind a command button:

Me.txtfield.enabled = false (where txtfield is the name of the appropriate box)

And to enable the field again:

Me.txtfield.enabled = true

Or to make invisible: Me.txtfield.visible = false


Or use a Combo Box by putting the code in the After Update Event of the combo box.

You don't want to use seperate tables, however this would be a good idea in this case. By using a second table for contact info you can ad as many contact records for each customer as needed. And you would avoid storage overhead. The way you are setting it up now will result in many empty fields in the table.
 
Last edited:
Thank You

Cheers Trucktime much appreciated for your help. Kind Regards Peter :) :)
 

Users who are viewing this thread

Back
Top Bottom