Field Visibility or Lock

S

Sebastiaan

I have a 'transaction type' field which uses a drop down list. Depending on
which transaction type is chosen, I would like to lock certain fields, or
have them dissapear. For instance if the delivery type is delivery, I do not
want the supplier field to be accessible to whomever is inputting the data on
the form. I have tried using a macro with the condition

[transactiontype]="delivery"

and then in the Item

[supplier].[visible]

and in the expression I have written

no

One of the problems seems to be that the OnCurrent even property does not
appear when I go to the events property box.

How do I fix this?

Regards

Sebastiaan
 
S

Steve

You first need to do something to force the user to select the transaction
type first.

Then use the select case function in the afterupdate event of your
TransactionType combobox to disable your fields according to the transaction
type selected:
Select Case Me!TransactionType
Case 1
Me!Field1.Enabled = False
Me!Field2.Enabled = False
Case 2
Me!Field3.Enabled = False
Case 3
Me!Field1.Enabled = False
Me!Field4.Enabled = False
etc
End Select

Note: The 1, 2 and 3 of the cases is the TransactionTypeID of your
transaction type table.

Steve
 

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