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

Got focus on field

Status
Not open for further replies.

KatGraham

Programmer
Feb 12, 2003
58
US
I have a subform that displays the first field with white background. (I'm assuming it has the focus) How do I get the subform field to display gray until the user actually goes to the subform fields?
 
Hi

Think I know what you mean,

set the enabled property of all controls on the sub form to false

in the onenter event of the subform control, put code to enable them, something like

Dim i as Integer

For i = 0 to me.mysubformcontrolname.FORM.Controls.Count - 1
Select Case me.mysubformcontrolname.FORM.Controls(i).ControlType
Case acTextBox
me.mysubformcontrolname.FORM.Controls(i).Enabled = True
end select
Next i

you may need to apply it to different control types, depending on what you have on your sub form

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
How are ya KatGraham . . . .

On most of my Data Entry forms I add a textbox specifically for the same reason . . . . I call it [blue]Parking The Cursor[/blue].

I make it the first control in the [blue]Tab Order[/blue], usually put it in the top-left of the [blue]Form Header[/blue], and set the Length & Width to zero. Besides hiding the cursor when you open the form, you now have a place to [blue]Park[/blue] the cursor, any time you choose.

As a matter of appeal, it does look better to have a clean form until you start entering data!

cal.gif
See Ya! . . . . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top