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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Set focus - the basics
I've been trying to 'set focus' to a field on one of my forms.
Formname = frm_Test Field name = gamma How do I set it so the field gamma is the field with focus ? Please keep it simple - I've looked in these groups and on the web and I can't seem to get it to work. All I get is invalid macro name Thank You |
#2
|
|||
|
|||
Set focus - the basics
Reader1 wrote:
I've been trying to 'set focus' to a field on one of my forms. Formname = frm_Test Field name = gamma How do I set it so the field gamma is the field with focus ? Please keep it simple - I've looked in these groups and on the web and I can't seem to get it to work. All I get is invalid macro name Thank You Forms have *controls*, not *fields*. If your control (TextBox, ComboBox, etc..) is named "gamma" then you would use... Me.gamma.SetFocus -- Rick Brandt, Microsoft Access MVP Email (as appropriate) to... RBrandt at Hunter dot com |
#3
|
|||
|
|||
Set focus - the basics
"Rick Brandt" wrote in message et... Forms have *controls*, not *fields*. If your control (TextBox, ComboBox, etc..) is named "gamma" then you would use... Me.gamma.SetFocus Sorry ! I meant controls really I did ! Where exactly do I put this text though ? |
#4
|
|||
|
|||
Set focus - the basics
Reader1 wrote:
"Rick Brandt" wrote in message et... Forms have *controls*, not *fields*. If your control (TextBox, ComboBox, etc..) is named "gamma" then you would use... Me.gamma.SetFocus Sorry ! I meant controls really I did ! Where exactly do I put this text though ? It's a line of VBA code so you put it in an event procedure that runs when you want the focus to be set. When do you want this to happen? -- Rick Brandt, Microsoft Access MVP Email (as appropriate) to... RBrandt at Hunter dot com |
#5
|
|||
|
|||
Set focus - the basics
I did it !!
:-) I put it in the on load event procedure Is that correct ? |
#6
|
|||
|
|||
Set focus - the basics
Reader1 wrote:
I did it !! :-) I put it in the on load event procedure Is that correct ? I suppose, but if you want a certain control to have focus when a form loads then you don't need code at all. Just make that control first in the TabOrder of the form. -- Rick Brandt, Microsoft Access MVP Email (as appropriate) to... RBrandt at Hunter dot com |
#7
|
|||
|
|||
Set focus - the basics
"Rick Brandt" wrote in message
. net... I suppose, but if you want a certain control to have focus when a form loads then you don't need code at all. Just make that control first in the TabOrder of the form. Thanks for that tip - I didn't know that either :-) |
Thread Tools | |
Display Modes | |
|
|