KeyDown Event at the Form Level - Question

cinders

Registered User.
Local time
Today, 18:33
Joined
Aug 28, 2001
Messages
48
Helo Everyone,

I need a little direction. I have an unbound field on a form where the text is formatted as white. I want to have the field switch to black when F10 is pressed. I need that event to happen from anywhere in the form. So I thought I could put the following code on the KeyDown event for the form:

Select Case KeyCode
Case vbKeyF10
RecExpID.ForeColor = 0
End Select

It doesn't appear to work. If I put the same code on the KeyDown event for any of the other fields within the form it works.

I have not worked with form events all that much.

Any suggestions?

Thanks in advance

Cindy
 
G’day Cindy

Well I just tried it and it worked.

Did you also set Key Preview to Yes?

Regards,
Chris.
 
No I didn't.

How/where do I set the key preview?

What does the Key Preview setting do?

Thanks

Cindy
 
It switches the key events on and off for the form.

Go to the form properties and scroll down to almost the bottom and you should find it.

Regards,
Chris.
 
Got it!

Thanks Chris.

I was getting a little frustrated over this one.

Thanks Again

Cindy
 

Users who are viewing this thread

Back
Top Bottom