Text Message in Access form when tabbing through

stirlsa

Board Regular
Joined
Sep 17, 2004
Messages
216
I want to create an event procedure in ACCESS under 'Events' to display a message on a form when the user gets to a certain field by tabbing.

1. Would 'On Got Focus' be the correct item to use? I tried in Code Builder to add the following text in the On Got Focus for the Check Box, but when I do the following, save it and tab through the form, nothing happens when I tab to that field.

Private Sub Check57_GotFocus()
Text = "You can use the space bar to easily select or deselect the check box."
End Sub
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
What you are basically doing with that line of code is setting the value of an undeclared variable equal to the message you want to send to the user. I think what you want is:

Code:
Private Sub Check57_GotFocus()
MsgBox "You can use the space bar to easily select or deselect the check box."
End Sub

Or a less obnoxious method would be
Code:
Private Sub Check57_GotFocus()
Dim status As Variant
status = SysCmd(acSysCmdSetStatus, "You can use the space bar to easily select or deselect the check box.")
End Sub

Private Sub Check57_LostFocus()
Dim status As Variant
status = SysCmd(acSysCmdClearStatus)
End Sub
 
Upvote 0

Forum statistics

Threads
1,212,928
Messages
6,110,734
Members
448,294
Latest member
jmjmjmjmjmjm

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top