How Can I Fix This

ecuevas

Registered User.
Local time
Today, 10:25
Joined
Jun 18, 2007
Messages
74
When my form opens the first line is highlited. How can I make it so that this doesn't happen?
 
Last edited:
can you take a screen shot? I'm not to sure what you're talking about.
 
Copy the line thats highlighted and past into a message or better still copy that procedure and post that.

mick
 
Title: Cell
Author: Stephen King
Genre: Horror
Price: $8.95
Amazon ISB: 0307391337



The stuff on the right is the part that can be edited. The line in red is highlighted when the form opens and I don't want this to happen.
 
Last edited:
I don't want any of them to be highlighted. Is this possible?
 
Do you want the cursor to be in a field and not be highlighted, or do you want no curser in any fields? If you want the curser to still be in the same field, you can try a sendkeys on the on open event. This worked for me:

SendKeys "{F2}"

It's not pretty, but it worked for me.
 
Pressing F2 makes it not be highlighted but when I close it and open it again the first line is still highlighted. I don't want any of the lines to be highlighted when the form opens. I am not sure if this is even possible.
 
If you put that code in the on open event, it should automatically do it everytime it opens. Maybe put it in the On load event as well.
 
Where exactly in the event would I put this line of code.
 
Last edited:
Go To Options Tab Keyboard Set The Behavior enter field to what you want, it will apply to all forms and dbs though
 
Go into the design view of the form.
Go into the properties of the form by right clicking the upper left hand box.
Scroll down until you see the "on open" property.
use the drop down and choose "Event Procedure"
click the 3 dot button next to the event procedure. This takes you into VBA
You will see the following code:

Private Sub Form_Open(Cancel As Integer)

End Sub

Enter the code in between the private sub and end sub. Code will end up looking like this:

Private Sub Form_Open(Cancel As Integer)
SendKeys "{F2}"
End Sub

On the top of the screen, click Debug then choose complile.
Then click debug again and choose click step into.

After this you can close vba and your database and reopen it. The code should work after that.
 
It worked, thanks. Do you know if I can make it so that the cursor is not in any of the lines?
 
the cursor has to go someware but what you could do is set all the controls so they have no tabstop. Unfortunately you will then in a postion where you cannot edit the record until the tabstops are reinstated. Is there a specific reason why you do not want the cursor in any of the fields. This is normal forms practice.
 

Users who are viewing this thread

Back
Top Bottom