Hi All
Is there any way to test if a form field has got focus. I have a button that runs code to filters by selection, but if any other field other than the field [MthFwd] is selected i want a message box to appear and tell the user to select a month from the MthFwd field before running the filter. Here is my code:
Thanks in advance for any help
LSteve
Is there any way to test if a form field has got focus. I have a button that runs code to filters by selection, but if any other field other than the field [MthFwd] is selected i want a message box to appear and tell the user to select a month from the MthFwd field before running the filter. Here is my code:
Code:
Private Sub cmdFBSelection_Click()
Screen.PreviousControl.SetFocus
'Code to check if MthFwd has focus. If not then msbbox and exit sub
DoCmd.RunCommand acCmdFilterBySelection 'Runs filter
End Sub
LSteve
Comment