View Full Version : this is driving me mad


Hiten
09-17-2001, 06:57 PM
I am building a db, and in a table when i select a certain product group from a look up table. I then only want the user to only enter certain information about that product group. so only certain fields a viewed on the screen how do i do that.

????

Thanks

Hiten

kbrooks
09-18-2001, 07:07 AM
Do you mean you want certain fields to 'appear' only if they answer a certain way, and different fields to 'appear' if they answer a different way?

The L&L Company
09-18-2001, 11:12 AM
If you are using a form for your entry and not datasheet view of the actual table you can use a combo box so the users can select the product group and then on the "After Update" event for that combo box you can write code (Select "Event Procedure" for the combo box's After Update Event) to hide or show the fields that you want the users to be able to type in or not type in.

If you show all of the fields on the form at first, set their "Visible" propety to True. Then on the "After Update" event of the Combo box you can write code like this in the code window...

_____________________________________
Private Sub [name of combo box]_AfterUpdate()

Select Case [name of combo box]
Case "Food"
[field1].visible= false
[filed3].visible= false
Case "Electronics"
[Field2].visible=false
End Select

I hope this helps.
~ Joe Maluso

[This message has been edited by The L&L Company (edited 09-18-2001).]