A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Remove Focus From text box



 
 
Thread Tools Display Modes
  #1  
Old October 15th, 2009, 05:25 PM posted to microsoft.public.access.forms
Neal Ostrander
external usenet poster
 
Posts: 11
Default Remove Focus From text box

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
  #2  
Old October 15th, 2009, 10:43 PM posted to microsoft.public.access.forms
Klatuu
external usenet poster
 
Posts: 7,074
Default Remove Focus From text box

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.
--
Dave Hargis, Microsoft Access MVP


"Neal Ostrander" wrote:

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

  #3  
Old October 15th, 2009, 10:52 PM posted to microsoft.public.access.forms
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Remove Focus From text box

On Thu, 15 Oct 2009 09:25:59 -0700, Neal Ostrander
wrote:

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.
--

John W. Vinson [MVP]
  #4  
Old October 29th, 2009, 03:07 PM posted to microsoft.public.access.forms
Neal Ostrander
external usenet poster
 
Posts: 11
Default Remove Focus From text box

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

"John W. Vinson" wrote:

On Thu, 15 Oct 2009 09:25:59 -0700, Neal Ostrander
wrote:

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.
--

John W. Vinson [MVP]
.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:45 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.