Programming, website development forum Get latest updates by RSS Follow TechnicalTalk on Twitter Follow TechnicalTalk on Facebook 
HomeSearchRecent PostsLoginRegisterContact Us

Username  
Password    
  Forgot your password?  

Pages: [1]   Go Down
 
  Email this topic  |  Print
0 Members and 1 Guest are viewing this topic.

MS Access: set focus to a textbox?

 
webmaster forum
maha22  Offline
Activity
0%
 
New Poster
Posts: 11
Topics: 5
August 14, 2010, 12:29:01 AM

I am using access 2002 to make a database for a friend, and ran into a functional problem.
I have radio buttons that switch that switch the subform, and make a search textbox invisible. Works fine, but when I hit the radio button to reactivate it, I found a problem. The subform changes, the search box comes back, but the radio button I selected still has focus. You have to click or tab back to txtSearch to begin a new search. Although a click or tab isn't much, it doesn't seem like a good way to leave it. I tried txtSearch. SetFocus, but it says it cannot set focus to a textbox. Is there a way around this?


Edit: Removed self promotion links. They are only allowed through signatures.
« Last Edit: August 15, 2010, 10:49:01 PM by Admin »
 
webmaster forum
Admin  Offline
*
 
Code Guru
Location: India
Gender: Male
Posts: 1387
Topics: 105
NaviBuster NaviBuster
WWW
August 15, 2010, 10:44:54 PM

Have you tried setting the setfocus() for the radio button through javascript? OR try giving the tabindex property of the text box.
 
webmaster forum
Activity
0%
 
Skilled Coder
Posts: 125
Topics: 0
March 03, 2011, 12:47:12 AM

You have to use setfocus() property of Textbox. You can find this property from the property window of textbox.

Network Management Service
 
webmaster forum
sd3189541  Offline
Activity
0%
 
New Coder
Posts: 44
Topics: 0
March 30, 2011, 09:41:31 PM

Please mention the code for that. Thank you.
« Last Edit: April 10, 2011, 09:54:17 PM by Admin »
 
webmaster forum
thesavo  Offline
Activity
0%
 
New Poster
Posts: 1
Topics: 0
July 07, 2011, 10:15:43 AM

I wanted this too.  I found a reference here.  

hxxp: www. access-programmers. co. uk/forums/showthread. php?t=151884

Thread: "move cursor to end of text in textbox after setfocus "

There is no stock function, but it can be added very easily.  The "Standard Module" they speak of in the topic is the VB code of the Form.   Specifically in the (General) area.

Any of your forms will now be-able to access this function.  I just tried it and it worked.

Cheers.


 
webmaster forum
3magic  Offline
Activity
0%
 
New Coder
Real name: Pooja Rani
Posts: 16
Topics: 0
WWW
July 10, 2011, 11:04:43 PM

For this you have to set setfocus() property of Textbox in the property window of textbox as setfocus().
« Last Edit: October 22, 2011, 10:36:42 PM by Admin »
 
webmaster forum
netshet  Offline
Activity
0%
 
Regular Coder
Posts: 73
Topics: 2
WWW
August 06, 2011, 02:16:04 AM

You don't need to set the focus to get the values.

All you need is to reference your control WITHOUT the .Text part. The default of a control is .Value which can be accessed by using

hair transplant
 
webmaster forum
Activity
100%
 
Regular Coder
Posts: 77
Topics: 0
January 04, 2012, 10:28:16 AM

Ms acces is easy to learn you just focus on property on text box

Yellow Pages of Pakistan
 
  Email this topic  |  Print
Pages: [1]   Go Up
 
Jump to:  



Powered by SMF 1.1.15 | SMF © 2011, Simple Machines


Google visited last this page February 09, 2012, 07:41:38 PM