[AccessD] OK versus Cancel

Rocky Smolin at Beach Access Software rockysmolin at bchacc.com
Mon Feb 23 11:50:08 CST 2009


John:

Thanks.  Works perfectly.  They hit enter and the switchboard comes up (if
password is correct, of course).  Enter correct password and click cancel
and the app quits.  Enter password and hit TAB, however, and the focus
shifts to the OK button.  Is there a way to finesse that?  Elsie I guess if
they use TAB, they'll just have to hit enter.

Of course, I'll have to ask the client why, at this point, they even need an
OK button.  (Lateral, Max, lateral.)




Rocky Smolin
Beach Access Software
858-259-4334
www.e-z-mrp.com
www.bchacc.com
 
 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby
Sent: Monday, February 23, 2009 9:33 AM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] OK versus Cancel

Checkout the Default property of the command button.  One and only one
button can have its default property set true.  If true this button will be
clicked when the user hits Enter anywhere on the form.  Set the Default
property of the OK button to true.  Now if the user clicks Cancel, they did
not hit Enter and the Cancel button click fires as you would expect.

Remove the code that calls the cmdOK_Click from the after update of the text
box.

John W. Colby
www.ColbyConsulting.com


Rocky Smolin at Beach Access Software wrote:
> Dear List:
>  
> I have a client app which opens to a form displaying log in combo, 
> password text box, a command button labeled OK and a command button
labeled Cancel.
>  
> The Cancel issues Application.Quit.  The OK checks the password, and 
> lets the user in of correct.
>  
> After entering the password the focus shifted to the OK button.  So 
> far so good.
>  
> Then the client wanted the user not to have to click OK after they 
> entered the password - just go right to the switchboard if the password
was correct.
> So I simply added Call cmdOK_Click to the After Update event of the 
> password text box and walla! no need to click OK.
>  
> But now if the user enters a correct password and clicks Cancel, the 
> program still goes to the switchboard because of the After Update 
> event call.  I can't see a way in the After Update event to know that 
> the user clicked Cancel.  Screen.ActiveControl.Name still shows 
> txtPassword.  The After Update event is triggering before the Cancel click
event apparently.
>  
> Is there a way to know the user clicked Cancel?  
>  
> MTIA,
> 
> Rocky Smolin
> 
> Beach Access Software
> 
> 858-259-4334
> 
> www.e-z-mrp.com <http://www.e-z-mrp.com/>
> 
> www.bchacc.com <http://www.bchacc.com/>
> 
>  
> 
>  
> 
>  
--
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