473,410 Members | 1,907 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,410 software developers and data experts.

Difference between dot and bang notation?

What is the difference between

Me.Lastname
Me!Lastname

TIA

Feb 16 '07 #1
4 14677
On Feb 16, 10:02 am, "Richard" <richard.goo...@devenezia.comwrote:
What is the difference between

Me.Lastname
Me!Lastname

TIA

The difference ultimately is where you use them and for what
reference. You can't reference a property or method with ! - just
objects. I have seen a lot of opinion about which is better used
where, but the practise I follow is...

- ! for an internal control reference. Eg. Code in a form module
refering to a control on the same form. - Me!Lastname
- . for an external reference and for properties and methods. Eg. in a
standard module - Forms("frmName").LastName.Visible

Feb 16 '07 #2
Richard wrote:
What is the difference between

Me.Lastname
Me!Lastname
In my own opinion, ultimately, the use of the dot lets you harness the
intellisense from the VBA which makes things much easier for code writing.

I've never had any problem using it.
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Be Careful, Big Bird!" - Ditto "TIM-MAY!!" - Me
Feb 16 '07 #3
"Richard" <ri************@devenezia.comwrote in
news:11**********************@t69g2000cwt.googlegr oups.com:
What is the difference between

Me.Lastname
Me!Lastname

TIA
In theory, the dot refers to a property of an object, The bang
refers to a member of a collection.

In practice, controls on a form are considered like properties,
even though they are members of the form/report's controls
collection.

Use the dot except when it doesn't work About the only place I
can think of where it doesn't work is in a recordset when
referring to the fields by name.

rs1.fields("myField") and rs1!myfield will work.
rs1.myfield will trigger an error.

--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

Feb 16 '07 #4
PW
On 16 Feb 2007 07:11:54 -0800, "storrboy" <st******@sympatico.ca>
wrote:
>On Feb 16, 10:02 am, "Richard" <richard.goo...@devenezia.comwrote:
>What is the difference between

Me.Lastname
Me!Lastname

TIA


The difference ultimately is where you use them and for what
reference. You can't reference a property or method with ! - just
objects. I have seen a lot of opinion about which is better used
where, but the practise I follow is...

- ! for an internal control reference. Eg. Code in a form module
refering to a control on the same form. - Me!Lastname
- . for an external reference and for properties and methods. Eg. in a
standard module - Forms("frmName").LastName.Visible

That's funny. I do the complete opposite of both those scenarios!

When I am writing code and want to reference a control on a form,
Access 2003 automatically locates the control if I type "dot" after Me
(Me.txtStartDate).

-pw
Feb 19 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: Edward Diener | last post by:
In the tutorial on functions there are sections on default arguments and keyword arguments, yet I don't see the syntactic difference between them. For default arguments the tutorial shows: def...
3
by: deko | last post by:
all this dot and bang syntax is confusing. if anyone can bring clarity to this subject I would really appreciate it. Forms!!.Form! -- to reference a text box on a subform But is this the...
22
by: Keith Tizzard | last post by:
I know this subject has been discussed many times and I do not wish to go over all the ground again but I have a particular problem. In the code for a Form I always use the dot notation to refer...
44
by: Darryl Kerkeslager | last post by:
I once did all my control references with the bang (!) operator. All my controls were referenced as Me!txtInput, etc. I have now discovered that doing this loses much more than Intellisense. ...
10
by: David | last post by:
what's the differences between: int main(int argc,char* argv){ ... } and: int main(int argc,char** argv){ ...
4
by: mosimu | last post by:
I have never fully understood what the difference is between these two forms of casting. Can anyone please clarify? long is a primitive data type so no, it's not calling a class constructor. ...
34
by: arnuld | last post by:
what is the difference between these 2: char name = "hackers"; char* name = "hackers";
6
by: =?Utf-8?B?UmljaA==?= | last post by:
If Not st1.Equals("something") then Do Something Else End If if str1 != "something" Then ... I realize that != is C# stuff and/or can be also be used in Tsql, but is there any implementation...
11
by: YZXIA | last post by:
Is there any difference between explicit inner join and implicit inner join Example of an explicit inner join: SELECT * FROM employee INNER JOIN department ON employee.DepartmentID =...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.