Remove Focus From text box

N

Neal Ostrander

I am using the forms beforeupdate event to check some textbox values. To do
this I have set the focus to one of the textboxes to get its value. The
problem I am having is that if I make anychanges on the record then click to
move to the next record the form doesn't advance unless I click the next
record button twice. Any Idea what might be causing this?
Neal
 
K

Klatuu

You are confusing Access. Setting the focus to a different control means
that you have to exit that control and go back to where the code was
executing before you changed focus. But, it is not necessary to set the
focus to a control to get its value.
 
J

John W. Vinson

I am using the forms beforeupdate event to check some textbox values. To do
this I have set the focus to one of the textboxes to get its value.

Well, no, you actually don't. The textbox's Text property is only available
when the textbox has the focus, but its (default) Value proprety is available
anytime. In the Form's BeforeUpdate event you can refer to

Me!textboxname

or

Me!textboxname.Value

with or without a setfocus.
The
problem I am having is that if I make anychanges on the record then click to
move to the next record the form doesn't advance unless I click the next
record button twice. Any Idea what might be causing this?
Neal

Please post your code.
 
N

Neal Ostrander

Thanks John
Using the Me!texboxname and getting the value worked. Just started
programming Access and not real familiar with all these great features yet.
Thanks Again
Neal
 

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