Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

active form

Status
Not open for further replies.

kkondrat1

MIS
Jun 30, 2004
4
US
I have a button on Form1, when I click the botton I want to close Form1. Next, I want Form2 to open, Form2 consists of 1 textbox. Here is the key: I want the curser blinking on the textbox. Yes, I have tried OnFocus, and it works fine but only after I make the form ACTIVE (The the textbox has the blinking curser after I click somewhere on the form). How do I make the form Active so I do not have to click on it?
 
You could run this from the form with the command button. It will set focus to the text box on the form you open.
Code:
Private Sub Command0_Click()
    DoCmd.OpenForm "Form2"
    Forms("Form2")("Text1").SetFocus
    
End Sub
 
No, that doesn't work, that is what I currently have.

the code does work by means of setting focus to the textbox, but when I open the form it does not set focus to the textbox until I click on the form. Its as if the form is not ACTIVE or something, I have to activate the form somehow for the cursor in the textbox to appear.
 
Private Sub Command66_Click()

Dim stDocName As String
Dim stLinkCriteria As String

DoCmd.OpenForm "LoanNumber"
Forms("LoanNumber")("TextSearch").SetFocus
DoCmd.Close acForm, "LoanInfo", acSaveNo
'stLinkCriteria
Exit Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top