Thanks Stuart for your help. I now have it working by using your suggestion of using the tag property. When MthFwd had focus i set the tag to a value of 1. when it lost focus it was set to a value of 0. This value is then used to run the relavent code.
There is so much to learn for us newbies.
Thanks again
LSteve
User Profile
Collapse
-
Test if a particular field has got focus
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:
...Code:Private Sub cmdFBSelection_Click() Screen.PreviousControl.SetFocus 'Code to check -
Thankyou all for your replys. I solved the problem by using the code sugested by ADezii. It works well. Thankyou AllLeave a comment:
-
Access Querydef with 2 parameters problem.
I am a newbie at VBA and in need of some help with how best to create a recordset from an existing Access Query that requires 2 Parameters from an open form. This query works fine as an ordinary query but i just can't get it to work using VBA. The 2 fields in the form to be used as parameters are
[CompanyName] and [MthFwd]. I am working with Access 2003 in Win XP. I have Microsoft DAO 3.6 in the references. Thanks in advance for any help....
No activity results to display
Show More
Leave a comment: