Making form Read Only

  • Thread starter Thread starter Joel
  • Start date Start date
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
 
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.
 
Back
Top