Locking Forms

J

Janna

I've used Allen Browne's Locking bound control codes
(http://allenbrowne.com/ser-56.html) to prevent overwriting data accidentally
My On Load property of the form is set to

=LockBoundControls([Form],True)

How might I change the above code so that if a specific date field is empty
on the form [dateappr], the form does not come up locked, but in all other
instances, it's locked when it opens?

Thank you.
 
T

Tom van Stiphout

On Sun, 12 Oct 2008 10:26:01 -0700, Janna

=LockBoundControls([Form], not Isnull(me.dateappr))

-Tom.
Microsoft Access MVP
 
J

Janna

Tom van Stiphout said:
On Sun, 12 Oct 2008 10:26:01 -0700, Janna

=LockBoundControls([Form], not Isnull(me.dateappr))

-Tom.
Microsoft Access MVP

I've used Allen Browne's Locking bound control codes
(http://allenbrowne.com/ser-56.html) to prevent overwriting data accidentally
My On Load property of the form is set to

=LockBoundControls([Form],True)

How might I change the above code so that if a specific date field is empty
on the form [dateappr], the form does not come up locked, but in all other
instances, it's locked when it opens?

Thank you.
 
J

Janna

Thank you for the prompt reply. I did try the code, but it didn't enable the
form to open unlocked if the date field was emply.

Tom van Stiphout said:
On Sun, 12 Oct 2008 10:26:01 -0700, Janna

=LockBoundControls([Form], not Isnull(me.dateappr))

-Tom.
Microsoft Access MVP

I've used Allen Browne's Locking bound control codes
(http://allenbrowne.com/ser-56.html) to prevent overwriting data accidentally
My On Load property of the form is set to

=LockBoundControls([Form],True)

How might I change the above code so that if a specific date field is empty
on the form [dateappr], the form does not come up locked, but in all other
instances, it's locked when it opens?

Thank you.
 
T

Tom van Stiphout

Then perhaps the value was not null. Debug this as follows:
Above the line, write:
Stop
Now run your code. You will stop at this line. Then use the debugger to
inspect the value of Me.dateappr. It likely is not null. Perhaps it is an
empty string. You could check that in the Immediate window by entering:
(Me.dateappr = "")
Adjust the code accordingly. Take out the Stop instruction.

-Tom.


Janna said:
Thank you for the prompt reply. I did try the code, but it didn't enable the
form to open unlocked if the date field was emply.

Tom van Stiphout said:
On Sun, 12 Oct 2008 10:26:01 -0700, Janna

=LockBoundControls([Form], not Isnull(me.dateappr))

-Tom.
Microsoft Access MVP

I've used Allen Browne's Locking bound control codes
(http://allenbrowne.com/ser-56.html) to prevent overwriting data accidentally
My On Load property of the form is set to

=LockBoundControls([Form],True)

How might I change the above code so that if a specific date field is empty
on the form [dateappr], the form does not come up locked, but in all other
instances, it's locked when it opens?

Thank you.
 
J

Janna

Figured out what I needed to change. Thank you Tom

Tom van Stiphout said:
Then perhaps the value was not null. Debug this as follows:
Above the line, write:
Stop
Now run your code. You will stop at this line. Then use the debugger to
inspect the value of Me.dateappr. It likely is not null. Perhaps it is an
empty string. You could check that in the Immediate window by entering:
(Me.dateappr = "")
Adjust the code accordingly. Take out the Stop instruction.

-Tom.


Janna said:
Thank you for the prompt reply. I did try the code, but it didn't enable the
form to open unlocked if the date field was emply.

Tom van Stiphout said:
On Sun, 12 Oct 2008 10:26:01 -0700, Janna

=LockBoundControls([Form], not Isnull(me.dateappr))

-Tom.
Microsoft Access MVP


I've used Allen Browne's Locking bound control codes
(http://allenbrowne.com/ser-56.html) to prevent overwriting data accidentally
My On Load property of the form is set to

=LockBoundControls([Form],True)

How might I change the above code so that if a specific date field is empty
on the form [dateappr], the form does not come up locked, but in all other
instances, it's locked when it opens?

Thank 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

Top