Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

when to use ! operator or . (dot) operator?

Status
Not open for further replies.

chdavisjr

Programmer
Jan 24, 2002
85
US
Where might I get more information on the differences in the ! or the . (dot) operators in Access expressions?
The Access 2000 help is not very explicit!
Thank you in advance.
Chalmers H. Davis, Jr.
 
When I use this with recordsets the . operator is used for methods and the ! is used for members.

EG.. to start editing a record in a recordset named rst I would use :

rst.edit...

to fill a field named itemname in the record I would use:

rst!itemname = .....

John Howley
 
chalmers,
In general, the dot is for built-in Access objects, properties and methods, the bang is for user-defined properties, objects, and methods.

For example,with Forms.count, "count" is a built in propery, while the statement Forms!MyForm, "MyForm" is a user-defined object. And, Forms!MyForm.name --"Name" is a built in property, tho its for a user-defined object, Forms!MyForm!text1, "text1" is a user defined object of that form.

Now, don't be confused because Access 'lets' you use the dot instead of the bang for things like textboxes--Forms!MyForm!Text1 and Forms!MyForm.Text1 will both work, but see thread181-183150 for reasons why you should always use the bang for these objects.
--Jim
 
Thanks and Kudos to both jhowley58 and JimHorton. Checking out Thread181-183150 above now.
Chalmers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top