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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SETFOCUS on a new form; new field on COMBO BOX 1

Status
Not open for further replies.

wacks

Programmer
Sep 10, 2001
58
US
hey! its my first time to join this discussion group coz i am just an amateur to Visual Basic Programming.

* upon opening a new form, i want to 'setfocus' my cursor to a particular textbox (new form) upon entering a command button (previous form). inserting my setfocus command in the form load creates an error... pls help

* i have a combo box with values in it. is it possible to insert new values inside that combo box?

thnx so much
 
Hi Wacks,

The error you're getting in form load is because the Text1.SetFocus is statement is been executed before the system has a chance to draw the form/textbox object.
Instead try:

Private Sub Form_Load()
Me.Show
Text1.SetFocus
End Sub

To add to a combobox
Combo1.AddItem item '

Jon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top