That's safe, Keith.
I use the dot, and don't bother with the prefix for bound controls (i.e. the
control has the same name as the field).
The only problem I've seen is when the field is *not* represented by a
control on the form, and you refer to the field as:
Me.MyField
That case can (but does not always) trigger the strange issue that Trevor
refers to.
It seems that the field-without-control is of the undocumented type
AccessField, and there must be some bugs in the way it is implemented. A
possibly related case can cause Access 2002 to crash (and possibly 2003).
That can happen where the LinkChildFields property of a subform control
refers to an AccessField type (i.e. a field in the subform's RecordSource,
that is not represented by a text box in the subform). Adding a text box for
this foreign key field stops the crashes.
BTW, the reason I prefer the dot is that if I mistype the control name, it
is caught at compile time.
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users -
http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"Keith Wilby" <keith.wilby@AwayWithYerCrap.com> wrote in message
news:Xns954B5B6D5E503keithwilby@10.15.188.42...[color=blue]
> Trevor Best <nospam@localhost> wrote:
>[color=green]
>> Using Me.ControlName can cause problems, if an object has the same name
>> as a property or method it can create confusion, either produce
>> unexpected results or just confuse a developer later on who looks at the
>> code. Additionally, it can produce random compile errors, one minute it
>> compiles OK the next it doesn't.[/color]
>
> That's interesting. I always use Me.ControlName but all my control names
> have prefixes such as 'txt' (text box) and 'cbo' (combo box) - is this
> relatively safe? I don't seem to get any compile errors. A97 BTW.[/color]