Don't want a text box selected when form opens

ML!

Registered User.
Local time
Today, 03:26
Joined
May 13, 2010
Messages
83
Wierd that I haven't run into this before. I have a static form with some unbound text boxes. When the form loads Access wants to select a control and therefore selects one of my unbound text boxes. Problem is they are hyperlinks and I don't want any selected which fills in the text box. I want them to be displayed so the user can select and click on the one of their choice.

None are tab stops. I do have an image object on the form as well as a transparent command button, both of which I also don't want selected because a border is added to the object.

Any ideas?
 
Use the SetFocus code in the event properties of your form's on open.

Pick a button, such as Refresh to be the focus.

This should work.
 
Maybe OnCurrent is a better place to put the Me.yourplace??.SetFocus
 
Sorry Bill, doesn't the SetFocus method do the same thing? If I set focus on any of the unbound text boxes, it fills the box. If I set focus on the transparrent cmd button, it adds a select border. I guess what I'm trying to accomplish is not setting focus on any control or object.
 
Create a Refresh button on your form. This is pretty docile and doesn't do much.
Set focus to this button so when the form opens the refresh button is highlighted.
 
I guess I can do that. I know I'm being nitpicky but I'm aiming for a real clean web-like interface and if I do that I might as well highlight the close button. I was just trying to avoid the border thats applied when an object has focus.

You're the awesomest :) for responding so quickly!
 
You could use a "fake" textbox. In Form Design View
  1. Place a textbox on the form
  2. With it selected, goto Properties and name it Fake
  3. Goto the Other Tab and set Tab Stop Property to No
  4. Move the textbox to the Top, Left-Most corner of the Detail Section
  5. Now, press and hold down <Shift> key.
  6. Use the Left and Up Arrows to reduce the textbox to a pinpoint
Now place this code in the code module
Code:
Private Sub Form_Load()
 Me.Fake.SetFocus
End Sub
 

Users who are viewing this thread

Back
Top Bottom