. vs !

M

mark r

why does one work and the other not?


using . instead of !

using _ instead of # in fieldname#


DOESNOT WORK:
If IsNull(ME!mmm#) Then
Me.mmm# = Me!ssn
End IF

DOES WORK:
If IsNull(ME.mmm_) Then
Me.mmm_ = Me!ssn
End IF
 
K

Ken Snell [MVP]

Names with # in them must be surrounded by [ ] characters:

Me![mmm#]


This is true for any non-letter, non-number, and non-underscore characters.
 
J

Jeff Boyce

Mark

As I recall, the dot (".") refers to methods and properties internal to
Access, while the bang ("!") refers to objects created by the user.

Both might work in a situation where the system-created object has the same
name as a user-created object. For example, binding a form to a query or
table and adding, say, a text control to the form results in a textbox with
the same name as the underlying control. If you are referring to the
value/data, I believe you can use either dot or bang.

Regards

Jeff Boyce
<Access MVP>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top