Apostrophe Mark

Can anyone defien me the differnce between 

[Forms].[frm1]
and
[Forms]![frm1]

when we use a "." and when "!"

0
Utf
11/28/2007 4:13:01 AM
access 16762 articles. 3 followers. Follow

2 Replies
663 Views

Similar Articles

[PageSpeed] 14

Abdul,

AFAIK no-one says this better than Dirk Goldgar, as follows...

--------------------------------------
"It's not so much a question of one or the other being "proper syntax", 
but that they mean different things that nevertheless almost always give 
the same result.  As I understand it, the bang (!) notation specifically 
denotes that what follows is a member of a collection;  in this case, a 
member of the form object's default collection, the Controls collection. 
  The dot (.) notation denotes that what follows is a property or method 
of the preceding object. That would logically make the bang notation 
"proper" and the dot notation improper.

But wait.  Wherever possible, Access makes the controls on a form and 
the fields in its recordsource all available as properties of the form. 
  It also makes the fields of the recordsource available via the bang 
notation.  I'm not sure exactly how it does this;  maybe if a name is 
not found in the Controls collection it checks the Fields collection of 
the form's recordset as a fallback position.  So for most practical 
purposes Me!ControlName and Me.ControlName evaluate to the same thing, 
and the timing tests I've seen suggest that there is little to choose 
between them as far as execution efficiency is concerned.  I seem to 
recall that there is a very slight difference, but I can't remember 
which way the advantage lies, and it's not much.  There's a coding-time 
advantage, however, to using the dot notation, as it makes the 
"intellisense" dropdown lists available. That's a strong argument for 
using the dot notation, in my book.

But wait again!  I said above that Access makes the controls available 
as properties "wherever possible".  There are cases where it can't do 
that. Specifically, it can't do it when there is already a property of 
the same name as the control in question.  For example, if your form 
"Form1" has a control or a field foolishly named "Name", currently
displaying the value "Ken Snell", then executing this statement in the 
form's code module:
         Debug.Print Me!Name, Me.Name

will print
     Ken Snell     Form1

in the Immediate Window.  So you must be careful not to use any reserved 
words or built-in properties as names for your controls, if you want to 
use the dot notation to refer to them.  But then, you should avoid doing 
that anyway, as it tends in general to confuse poor Access.
-------------------------------

-- 
Steve Schapel, Microsoft Access MVP


Abdul Shakeel wrote:
> Can anyone defien me the differnce between 
> 
> [Forms].[frm1]
> and
> [Forms]![frm1]
> 
> when we use a "." and when "!"
> 
0
Steve
11/28/2007 7:54:21 AM
A little comment:
dot notation is slightly faster than bang, as Access does not have to 
iterrate through the whole controls collection. Also
Using the dot notation will lead to a compile error if a control is 
non-existant (renamed /deleted), whereas bang notation will "only" lead to a 
runtime error.

Pieter

"Steve Schapel" <schapel@mvps.org.ns> wrote in message 
news:%23tm3jPZMIHA.5224@TK2MSFTNGP02.phx.gbl...
> Abdul,
>
> AFAIK no-one says this better than Dirk Goldgar, as follows...
>
> --------------------------------------
> "It's not so much a question of one or the other being "proper syntax", 
> but that they mean different things that nevertheless almost always give 
> the same result.  As I understand it, the bang (!) notation specifically 
> denotes that what follows is a member of a collection;  in this case, a 
> member of the form object's default collection, the Controls collection. 
> The dot (.) notation denotes that what follows is a property or method of 
> the preceding object. That would logically make the bang notation "proper" 
> and the dot notation improper.
>
> But wait.  Wherever possible, Access makes the controls on a form and the 
> fields in its recordsource all available as properties of the form. It 
> also makes the fields of the recordsource available via the bang notation. 
> I'm not sure exactly how it does this;  maybe if a name is not found in 
> the Controls collection it checks the Fields collection of the form's 
> recordset as a fallback position.  So for most practical purposes 
> Me!ControlName and Me.ControlName evaluate to the same thing, and the 
> timing tests I've seen suggest that there is little to choose between them 
> as far as execution efficiency is concerned.  I seem to recall that there 
> is a very slight difference, but I can't remember which way the advantage 
> lies, and it's not much.  There's a coding-time advantage, however, to 
> using the dot notation, as it makes the "intellisense" dropdown lists 
> available. That's a strong argument for using the dot notation, in my 
> book.
>
> But wait again!  I said above that Access makes the controls available as 
> properties "wherever possible".  There are cases where it can't do that. 
> Specifically, it can't do it when there is already a property of the same 
> name as the control in question.  For example, if your form "Form1" has a 
> control or a field foolishly named "Name", currently
> displaying the value "Ken Snell", then executing this statement in the 
> form's code module:
>         Debug.Print Me!Name, Me.Name
>
> will print
>     Ken Snell     Form1
>
> in the Immediate Window.  So you must be careful not to use any reserved 
> words or built-in properties as names for your controls, if you want to 
> use the dot notation to refer to them.  But then, you should avoid doing 
> that anyway, as it tends in general to confuse poor Access.
> -------------------------------
>
> -- 
> Steve Schapel, Microsoft Access MVP
>
>
> Abdul Shakeel wrote:
>> Can anyone defien me the differnce between [Forms].[frm1]
>> and
>> [Forms]![frm1]
>>
>> when we use a "." and when "!"
>> 


0
Pieter
11/28/2007 10:28:09 AM
Reply:

Similar Artilces:

Apostrophe in Combo Box
I have a combo box which displays the employee names from a table. Users select an entry to "reassign" a unit of work to another individual. There are several employees with apostrophies in their name. The name appears without the apostrophe in the combo box, so when work is reassigned, it displays the name differently than when updated from any other process. Example: Audit trail updates show the individual as "O'Connor" but updates using the combo box show "OConnor". Is there any way, without using code to load the combox, to display the correct name...

How do I insert a check mark into a cell?
Is there a way to insert a checkmark into a cell in an Excel spreadsheet? I have not been able to find an ANSI character code for check mark...any suggestions would be greatly appreciated. Thank you, Mark Charleston Mark, Format the cell as Wingdings. Then hold down the Alt key and type "0252" on the numeric keyboard and press the Enter key. John Mark Charleston wrote: > Is there a way to insert a checkmark into a cell in an > Excel spreadsheet? I have not been able to find an ANSI > character code for check mark...any suggestions would be > greatly appreciated. ...

Reviewing Marks
Hi Have used Word extensively but never had the need to use the reviewing marks. Unfortunatley I have now received a huge document back that I sent off, with reviewing marks all over the place. I accept all the changes but now have to somehow get rid of all the reviewing marks and format the document again. I can't seem to get rid of the marks. Even going to the final document, saving, as soon as you open it again they are all back. I have read the answers to these questions here, but I am afraid can't follow - answers seem to go on about email options!! Someone pl...

need HELP removing box with question mark PLEASE
Hi. I exported a list of contacts from microsoft outlook as a .csv file. In the notes section of the outlook file I have items that are separated with a carriage return which then has notes on the next line and next line and so on. Well when viewing the data in excel, those carriage returns show up as a box with a question mark. Well I was going to use the "text to columns" command, but that won't work with that pesky box with a question mark inside. So unless someone has another idea, I need to replace that thing with a comma, so then I can separate those lines into individ...

Apostrophe problem
Hello, I am working with a spreadhseet and the data looks normal, however when you click on the cell the data value contains a leading apostrophe. for example the data looks like this: '4 '8 '10 '8 IS there a quick and easy way to get rid of the leading " ' "? If so, an advice on how to do this would be greatly appreciated! Copy an empty cell, select the values and do edit>paste special and select add -- Regards, Peo Sjoblom "bcap" <rayh@patriots.com> wrote in message news:1185201567.622591.247730@k79g2000hse.googlegroups.com....

Adding Qoutation mark " to CString
Hi, I am not able to add " to my Cstring. I want a string like temp"12 For example CString s = "temp\"12"; this gives temp12 CString s = "temp\\"12"; - this gives compile error. Only option is to work like this Cstring s; s = "temp"; s = s + "\\"; s = s + "12"; is there any other way to put qoutation marks directly in a string? Regards, Anubhav "Anu" <anu.mishra@gmail.com> ha scritto nel messaggio news:1188978902.338047.213140@22g2000hsm.googlegroups.com... > I am not able to add " to my Cstr...

How can I place check mark
How do I place a check mark in Excel (2002)? I tried insert symbol but did not find anything. Thanks. Hi Paul One way If the Cell font is Wingdings2 you can use the uppercase P -- Regards Ron de Bruin http://www.rondebruin.nl "Paul T" <PaulT@discussions.microsoft.com> wrote in message news:3509A715-38A8-4DC1-9341-3E2FD95DD808@microsoft.com... > How do I place a check mark in Excel (2002)? I tried insert symbol but did > not find anything. Thanks. That works. Thanks. "Ron de Bruin" wrote: > Hi Paul > > One way > > If the Cell font ...

Apostrophe
When I try to insert an apostrophe the letter e' shows up rather than the apostraphe ' . There is no problem here, only when typing an email in Windows Live Mail, this has just started, have I inadvertantly hit a key? -- A.N.Other Sounds like you might have done this - How To Use the United States-International Keyboard Layout in Win7, Vista and XP http://support.microsoft.com/?kbid=306560 -- Mike - http://TechHelp.Santovec.us "A.N." <AN@discussions.microsoft.com> wrote in message news:230B1110-E912-4031-8468-ACF10AF3FD4C@microsoft....

More apostrophe nightmares
My form is driving me crazy because of stupid apostrophes in the data which the form is drawing from. I have 2 combos. cbo #1 is populated by project names. (The control is also named "Project Name" while the cbo #2 is named "Tenant" and is populated by tenant names from the tenant field in the table. I know this is bad form, so to speak, but lets please ignore that today. I didn't create the form or the control and I have limited time so I have to pick my battles). When I select a project in the first cbo "Project Name", the goal is to have the tenant cb...

Re: foreign language accent marks
On Sat, 12 Jun 2010 11:10:45 -0400, Jeff Zeitlin <msforums@freelancetraveller.com> wrote: > >On Sat, 12 Jun 2010 08:13:49 +0100, Dominic Payer <dcp@dcp.fsv.co.uk> >wrote: > >>Find Character Map in your Windows Accessories/Tools menu and note and >>remember the Alt+numeric sequence for the accented characters you need >>in the fonts you use. >> >>The numbers in the sequences must be entered on the right hand numeric >>keypad not the numeric keys above the keyboard letters. > >This is not going to always be possi...

Marking spam
I have just reinstalled Outlook 2007 and activated spam filters, set to "Low." Now I am finding that much of my email--some of it not spam--is marked SPAM. This wasn't happening before. How do I shut it off? Joe Parsons Do you mean the word SPAM is actually in the subject or elsewhere in the mail item? If so, that's another program or your providers server doing that. "jmparsons3" <jmparsons3@gmail.com> wrote in message news:8f3a5fae-a5cc-4868-97f0-618feefa1eb1@y33g2000prg.googlegroups.com... > I have just reinstalled Outlook 2007 and activated spam ...

email address format
I ran into a problem that I cannot find documentation for. I created a distribution list in the format !name@domain.com I realized that Exchange 2003 would not accept internet email to that address when the exclamation mark is the first character in the email address. Can someone confirm that is the case or some weird bug? Thanks. ...

apostrophe
How do you remove the apostrophe in a cell? I have numbers and text imported from another program. Hi Dana, One way: Sub DeleteApostrophes() Dim rCell As Range Dim Rng As Range Set Rng = ActiveSheet.UsedRange '<<=== CHANGE For Each rCell In Rng If rCell.PrefixCharacter = "'" Then rCell.Value = rCell.Value End If Next rCell End Sub If you do not wish the procedure to operate on the whole sheet. you should set Rng to an appropriately restricted range. --- Regards, Norman "Dana" <Dana@discussio...

Apostrophe Problem
I use a control on a form which I have concatenated from the users First and last names. All works well if I select, Harry Smith, but when I select a name with an apostrophe in it, Kelly O'Malley, I get a run time error 3077. The coding is: Private Sub Combo80_AfterUpdate() ' Find the record that matches the control. Dim rs As Object Set rs = Me.Recordset.Clone rs.FindFirst "[Name] = '" & Me![Combo80] & "'" If Not rs.EOF Then Me.Bookmark = rs.Bookmark End Sub Any suggestions? Thanks Add this to a standard ...

how do I insert tally marks in an office document?
I am trying to insert a tally chart in an office document.Any suggestion. Are you trying to create a fill-in form? Or simply a manual check-off? If it is the former: Create a Fill-in Form in Word http://www.computorcompanion.com/LPMArticle.asp?ID=253 Lots of images here for tally charts, it might give you an idea on how to proceed http://images.google.com/images?hl=en&q=tally+charts&um=1&ie=UTF-8&ei=_kYUSpHSF5iu8QTn7uiQBA&sa=X&oi=image_result_group&resnum=1&ct=title -- Mary Sauer http://msauer.mvps.org/ "STARR" <STARR@discussions.microsoft.co...

Change/mark duplicate entries in account as similar.
Hi, I have a credit card account, and checking account. I end up with: Credit card account: -100 dollars I pay my credit card bill with the checking account: Checking -100 dollars I mark it as a Transfer from Checking TO Credit Card. The credit card account now ends up with 2 duplicate entries: CC -100 CC -100 I click on the "Change" button, and mark them as identical and everything works perfectly. But if I happend to already mark both entries, I can not go back and change them to identical. I can not find this option when I already categorized an entry! I end up with duplic...

apostrophes
I have a formula with an apostrophe, but it's not a leading apostrophe. ='results.csv!$B1 I wrote it this way for reasons I won't bore you with, but there is a good reason. The idea is that a particular moment I can take out the apostrophe using find/replace and thus activate the formula. I know removing the apostrophe by using find/replace doesn't work on leading apostrophes, but it does work on non-leading apostrophes in some circumstances. Does anyone know what those criteria are? On some spreadsheets it works, on others it doesn't. If they are like your exa...

Revision marking greyed out
Revision marking is on. All changes are greyed out so I can not accept or reject any changes. Is the document protected? You might try unprotecting it. "Ken W" wrote: > Revision marking is on. All changes are greyed out so I can not accept or > reject any changes. It's not protected. "Jerry" wrote: > Is the document protected? You might try unprotecting it. > > "Ken W" wrote: > > > Revision marking is on. All changes are greyed out so I can not accept or > > reject any changes. ...

Apostrophe in search string
I have a simple SQL string that is run from a form when a field is updated: strSQL = "UPDATE tblDesign " & _ "SET " & strFieldNameForUpdate & " = '" & strDM & "' " & _ "WHERE DesignName = '" & strName & "' ;" It works fine except for where there is (rarely) an apostrophe in the strName field data. I cannot work out how many extra quotes to put into the sql build string to get round this. A debug.print of the string that causes a syntax problem is: UPDATE tblDesign S...

apostrophe
Hi all, I just received an excel workbook where all the numbers have been typed with an apostrophe ' in front of them, therefore no formulas work, i.e., the worksheet does not view them as numbers. Going in to each cell and removing the apostrophe works, but the table is way to big to do that for every cell. I tried find/replace, but it doesn't find the apostrophe's. I also tried reformatting the columns, copying and using the various forms of "paste special", etc., and have yet to find anything that works. Any ideas? Thanks, Steve Hi Steve, =A1*1 will reve...

removing leading ' (apostrophe)
I have been given a spreadsheet by another department that was exported form another package. The problem I have is that all the data in every cell has a leading ' (apostrophe). For example, when you look at the contents of the cell that displays as 12/31/2003, it shows '12/31/2003. I've tried to format the cells, but that doesn't work. Is there any easy way to remove the leading character for the whole column or sheet? Thanks in advance for help. --- Message posted from http://www.ExcelForum.com/ edit/replace -- Don Guillett SalesAid Software donaldb@281.com "...

how to place a "check mark" in a column
I need to show whether or not an employee has completed a program. I would like to use an x for no and a "check mark" for yes. Is there anyway to do this? Thanks for your help. Check this previous post for a starter http://tinyurl.com/sbur -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Lisa" <anonymous@discussions.microsoft.com> wrote in message news:2ad201c3fcab$81b38960$a401280a@phx.gbl... > I need to show whether or not an employee has completed a > program. ...

Marking all lines with same value when a second value is found
I have a excel 2003 spreadsheet with a list containing order number, date, status. I want to create a function to give a value in a new field for all order numbers if one of the statuses is 'on hold' My data would be like below Order# Date Status 1 7/1/2005 Received 1 7/2/2005 Closed 2 7/1/2005 Received 2 7/2/2005 On Hold 2 7/5/2005 Closed In the new field I would like all that lines for order 2 to have a "Yes" value in the new field because one of the status was On Hold say your data is in th...

More apostrophes!!
The following causes errors on my forms when the record contains an apostrophe: Private Sub Combo2_AfterUpdate() ' Find the record that matches the control. Dim rs As Object Set rs = Me.Recordset.Clone rs.FindFirst "[ownername] = '" & Me![Combo2] & "'" Me.Bookmark = rs.Bookmark End Sub what changes do i need to make? tia Will your data contain double quotation marks? If not, try: rs.FindFirst "[ownername] = """ & Me![Combo2] & """" Anthony Speiser wrote: >The followi...

Peculiar apostrophes...
Just a quick one ( I think), Pointed at a page in the (UK) Times, I use the 'File/Send To/Mail Recipient' sequence to pass it on, and the subject line comes out: Prince Charles blames world�?Ts ills on �?~soulless consumerism�?T and Galileo - Times Online With the article's title apostrophes replaced. It happens with either of OE or Outlook as the default. Is this likely to be a fault at my end, or is it in the newspaper's site? Cheers, S Check your settings in IE (yes, IE) View | Encoding. Spamlet wrote: > Just a quick one ( I think), > ...