Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Keep Focus in Password TextBox

Posted on 1999-01-11
5
Medium Priority
?
271 Views
Last Modified: 2010-05-03
I have a password program and it doesn't keep the "Focus" in the textbox. I have it run from the startup folder and it loads with other programs and looses its focus. You have to put the mouse prompt in the box and click to get the focus back. Could someone list some code that will eliminate this?
Thanks A Lot
0
Comment
Question by:dropfork
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 

Accepted Solution

by:
wenchang earned 200 total points
ID: 1455551
did u set teh focus in the password textbox in the first place....
on form load ...
txtPassWord.SetFocus
0
 

Expert Comment

by:wenchang
ID: 1455552
did u set the focus in the password textbox in the first place....
on form load ...
txtPassWord.SetFocus
0
 

Author Comment

by:dropfork
ID: 1455553
Hey Wenchang: I don't have this routine in my form load. My form load gets me the user name and restricts the form and mouse. The OK (command1 button) is where my txtpassword is. I can put your code in this area but it has no effect. If I put it in the form load area, I get "error city" because txtpassword is not in this area ? Maybe you can give me an example in another way. Maybe there is not a way with the way I have made this program.
(The mouse is restricted to the password form. The user name is called from the form load area. The txtpassword is located in the command1 "OK button" area). Everything works better this way for my program. (don't ask) If you have enough information from the above you can give it another shot if you want. I may be stuck with a trial and error situation because of the way this program was constructed.
Thanks for any further input...
0
 
LVL 10

Expert Comment

by:caraf_g
ID: 1455554
Try this:
On the form's Activate event, set focus to the control in question.
0
 

Author Comment

by:dropfork
ID: 1455555
Caraf's way was correct for me. Wenchang's way was correct too but not applicable under my weird program. I wish to thank caraf for answering my "weird problem" and Wenchang for giving the normal correct answer...
Thanks Again !
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Suggested Courses

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question