setfocus problem

T

TC

You can't do that from beforeupdate. You must set a flag for AfterUpdate, &
do it from afterupdate.

HTH,
TC


R. Choate said:
I have code in the beforeupdate event of a textbox to validate the entry.
If the user enters an invalid entry and there is specific
text in another textbox, I need to clear the current textbox and set the
focus to that other textbox on the form. My problem is not
the existing code, it just does not want to allow me to clear the current
box and then move the focus. Please tell me how I can get
 
R

R. Choate

I have code in the beforeupdate event of a textbox to validate the entry. If the user enters an invalid entry and there is specific
text in another textbox, I need to clear the current textbox and set the focus to that other textbox on the form. My problem is not
the existing code, it just does not want to allow me to clear the current box and then move the focus. Please tell me how I can get
this done.
 
R

R. Choate

I thought I had already tried that, but I tried it again after you suggested it and it worked, so that did help. Thank you.
--
RMC,CPA


You can't do that from beforeupdate. You must set a flag for AfterUpdate, &
do it from afterupdate.

HTH,
TC


R. Choate said:
I have code in the beforeupdate event of a textbox to validate the entry.
If the user enters an invalid entry and there is specific
text in another textbox, I need to clear the current textbox and set the
focus to that other textbox on the form. My problem is not
the existing code, it just does not want to allow me to clear the current
box and then move the focus. Please tell me how I can get
 
K

Ken Snell

You also can use the Form's BeforeUpdate event to check the validity of the
controls' contents, and then to set the focus to a control that needs
correcting.

--
Ken Snell
<MS ACCESS MVP>

R. Choate said:
I thought I had already tried that, but I tried it again after you
suggested it and it worked, so that did help. Thank you.
 
R

R. Choate

Thanks, Ken. I will be able to use that idea quite a bit.
--
RMC,CPA


You also can use the Form's BeforeUpdate event to check the validity of the
controls' contents, and then to set the focus to a control that needs
correcting.

--
Ken Snell
<MS ACCESS MVP>

R. Choate said:
I thought I had already tried that, but I tried it again after you
suggested it and it worked, so that did help. 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