Macro to enter a standard text response in any field

MsT

Registered User.
Local time
Today, 08:52
Joined
Oct 24, 2008
Messages
14
Hi, thanks in advance for your help

I am filling in a database using forms, and I would like to be able to add standard values to any field using a macro/VBA code
I don't want to set up a different macro for each field though - I have around 40 different fields (to elaborate, it's a mark database for student projects, each field is a different thing I am commenting on. I want to quickly add 'Missing' or 'Good' to a field - but I also want the option of free text instead.)

I can do it easily in Excel cells but can't figure how to do it in MS Access.

Regards
Fran
 
Create a textbox for each of the fixed texts.

In the Default property of each insert the text you want. In the VBA code for the Click event of each such textbox, insert:

Screen.PreviousControl=Me.NameOfMyTextBox (or somehting equivalent in macros - no clue what)

Done.

When you click on that textbox the text will be inserted in the last control that had focus before you clicked on the textbox. To make the focus more explicit, there is some useful code here to show which control has focus: http://allenbrowne.com/highlight.html
 
This is absolutely awesome. Thanks so much.
 

Users who are viewing this thread

Back
Top Bottom