Locked fields in form

G

Guest

Hi All,

I have a database that I want the fields locked only when a check box is
ticked. I have set the On Current property of the from to
=LockBoundControls([Form],True) and this works but I would like it to only be
this way if the "Paid" check box is checked. I have tried the IIF formula
=IIF([Paid]=True,LockBoundControls([Form],True)) but this didn't work. Can
someone please help. I am a self-taught Access user so any hints would be
appreciated.

Thanks
Janine
 
B

Brendan Reynolds

I'm assuming that LockBoundControls is a custom VBA function that takes two
parameters, a reference to a form and a Boolean value. Given that
assumption, I believe it should work if you pass the value of the check box
as the second parameter instead of the hard-coded value True. Something like
....

=LockBoundControls([Form], [Paid])

... or perhaps ...

=LockBoundControls([Form], NZ([Paid],0))

The second example above is using the Access NZ function to handle the
possibility that the value of the check box might be Null.
 

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