[AccessD] Locking a textbox based on other form controls

Charlotte Foust cfoust at infostatsystems.com
Thu Aug 17 11:27:38 CDT 2006


OK, the message is misleading, but it still boils down to the same
problem.  You're in the middle of modifying a value in one control, so
you can't go off and lock the other one.  Some things HAVE to be done in
afterupdate.  I'll let someone else figure out the messy details of why
it behaves this way.

Charlotte Foust 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Christopher
Jeris
Sent: Thursday, August 17, 2006 9:19 AM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Locking a textbox based on other form controls

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Charlotte Foust wrote:
> The Change event happens on every keystroke, including the first one.
> Type "a" and that's a change and you're trying to lock the control you

> just typed an "a" into without leaving the control and committing the 
> value.  That's what the message means.  I think you want the 
> afterupdate event of the control, not the change event.

But that's not what I wrote, and not the problem.

If I were trying to lock Text2 when I typed into Text2, the message
would make perfect sense.

In fact, when I type into Text2, I'm trying to lock the OTHER box,
Text0:

  ' The function of Text2 is that when it is changed, Text0 is locked:
  Private Sub Text2_Change()
      Me![Text0].Locked = True
  End Sub

This is exactly why I'm so confused.  When the complaint comes up, "You
can't lock a control while it has unsaved changes", the control I'm
trying to lock has _never_been_changed_.

It's possible the AfterUpdate event is what I want, but I'd still like
to figure out what's going on here.

thanks, Chris Jeris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFE5Jba5ICCNV0oGWARAjLeAJ0R+LbbUF7K+8n118rsUY1VNBZQlgCfQq9g
yzPWdkBGLW6kdjygZXWFOMk=
=+r0f
-----END PGP SIGNATURE-----
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



More information about the AccessD mailing list