SetFocus Problem + AfterUpdate Problem 
Author Message
 SetFocus Problem + AfterUpdate Problem

Hello.
I have 2 problems on a insert form. The first one is with
a SetFocus property that is not working. The problem is
that the users have to insert a code that must be unique,
and i created a msg that appear if the code already
exists, and this is working. But i want that, when the
user clicks OK in the MsgBox the focus returns to the code
textbox, and stay there until the user enters a new code.

The second problem is with a Username Password validation.
I have AfterUpdate event on the password textbox to
validate the user, with a message if the user is not
valid. So far so good. The problem is if the user just
press Enter in the text fields with Null values. If this
happens the AfterUpdate event doesn't work. How can i do
sometihing like the AfterUpdate event in this situation.



Tue, 04 Jul 2006 23:06:34 GMT  
 SetFocus Problem + AfterUpdate Problem

Quote:

>I have 2 problems on a insert form. The first one is with
>a SetFocus property that is not working. The problem is
>that the users have to insert a code that must be unique,
>and i created a msg that appear if the code already
>exists, and this is working. But i want that, when the
>user clicks OK in the MsgBox the focus returns to the code
>textbox, and stay there until the user enters a new code.

>The second problem is with a Username Password validation.
>I have AfterUpdate event on the password textbox to
>validate the user, with a message if the user is not
>valid. So far so good. The problem is if the user just
>press Enter in the text fields with Null values. If this
>happens the AfterUpdate event doesn't work. How can i do
>sometihing like the AfterUpdate event in this situation.

Why don't you use the BeforeUpdate event?  It has a Cancel
argument that will prevent the focus from moving, so you
don't have to worry about trying to use SetFocus at a time
when it can't be used.
--
Marsh
MVP [MS Access]


Wed, 05 Jul 2006 01:13:39 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Using .setfocus with afterupdate

2. setfocus of a textbox AfterUpdate

3. AfterUpdate, SetFocus, and item receiving focus

4. userform afterupdate problem.

5. Textbox AfterUpdate problem

6. mainform control AfterUpdate problem?

7. AfterUpdate Problem

8. AfterUpdate Problems

9. AfterUpdate Event Data Record Problems

10. AfterUpdate code problem


 
Powered by phpBB® Forum Software © phpBB Group