Making form Read Only

J

Joel

I want to do this to make my form read only if someone
else has opened it first:

In Item_Open check a Boolean UserProperty on the item to
see if it's True. If it is, someone else has it opened it
first. Then disallow saving that item (cancel in Write and
you can lock your controls). If it's False set it to True
so other users will see it as read-only. When you exit the
form clear that property back to False.

Can someone point me to some sample code? I am a beginner
VB'er but can handle it if I see something close.

Thank you! - Joel
 
R

reto

your solution is correct

you just have to translate it into vbscript

don't use bound controls, load the value of yourproperty into the control when item_open() happens. then you can decide whether to save it or not in item_write(

sub item_open(
if yourproperty=true the
set all controls to readonly=tru
els
set yourproperty=tru
end i
end su

sub item_write(
if yourproperty=false the
item.yoursecondproperty=yourtextbox.valu
item.yourproperty=tru
end i
end su

it shoul work somehow like this.
 

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