Using Me! property

mango97

Registered User.
Local time
Today, 12:09
Joined
Jul 24, 2014
Messages
40
Hi, I'm working on one of my first complex databases and as a result I am using the me! property for the first time. I've been experimenting with showing and hiding controls on the click of a button and have ran into a problem:

One of my controls named WO# and I have been unable to get the me! property to work with it. Does the # prevent the code from running?

Thanks,

mango97
 
You need to bracket it, i.e.
Code:
[WO#]

Hmm, you really should avoid wildcard characters in Field Names....

I also never use spaces or underscores or special characters... Spaces and special characters mean I have to bracket field names and/or table names. Underscores is just one extra character to type. Okay, now you're thinking, what's the big deal? Less typing... when you realize you're going to *type* code and lots of it... Not only is that pesky underline just another character that must be typed in the name, it is not an easy character to type. (Hold down the Shift key, then reach with the little finger, or is it the ring finger, and hope you hit the right key.) Just leave it out, use Camel Back and your field names will be very easy to type and read! (Thanks to Victor R. for the suggested amendment.)

From: My Naming Conventions http://www.access-diva.com/d1.html
 
Also, I would use Me. not Me!
 
Not only is that pesky underline just another character that must be typed in the name, it is not an easy character to type.

Moreover the underscore is used by Access to separate Object names from the Event name in VBA Event Procedures. Including an underscore in the object name makes the name of the procedure less obvious.

Access also substitutes the underscore for the dot when linking tables from systems that use the dot in names such as the schema part of a name in MS SQL Server.

And finally the underscore in not much more than a space when looking at code. It is easier to see exactly where the spaces lay in the code of every character in names has a high profile.

And as if there were not already plenty of reasons to avoid spaces in names, avoiding them is a good idea for the same reason.
 

Users who are viewing this thread

Back
Top Bottom