Locking and Unlocking Fields

L

louishong

Hello,


I have a continous form where one field has a combo box with various
values. Depending on what the user selects I would like to lock
certain fields.

Here's an example:
Field one is a combo box with different colors (red, blue, green)
If the user selects Red then fields 3 & 4 would be locked for editing
If the user selects Blue then fields 2 would be locked for editing
If the user selects Green then fields 2 & 4 would be locked for editing

Field 1 Field 2 Field 3 Field4
Red X X
Blue X
Green X X

Is this possible on a continous form? Any help would be appreciated.
TIA
 
A

Allan Murphy

Louis

You could you the following



We will call your combo box cmbo_colour

In the after update event of the combo box

Select case cmbo_colour

case "Red"

field2.enable=true

field3.enable=false

field4.enable=false


case "Blue"

field2.enable=false

field3.enable=true

field4.enable=true

case "Green"

field2.enable=false

field3.enable=true

field4.enable=false

End select

It is possible on a continuous form providing that you are not using unbound
fields.

Allan Murphy

Email: (e-mail address removed)
 
L

louishong

Hi Allan,


This seems to affect all the records not just the individual record
where the selection is made.

Also, it seems to only work when the change is made to the first
record. If Red is selected in the 2nd, 3rd, 4th...record nothing
happens to that record or any other records.

Is there a way to have it work regardless of the record selected and
also
 
A

Allan Murphy

Louis

I had a similar problem using a continuous form where I ticked a box and all
the records were also updated with a tick. I found that I was using an
UNBOUND box.

Reply to me off list and I maybe able to help you.
 

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

Similar Threads


Top