setfocus problem

  • Thread starter Thread starter TC
  • Start date Start date
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
 
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.
 
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
 
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.
 
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.
 
Back
Top