f

#### '!' vs. '.'

Is there an advantage to using the '!' notation to represent form/
control relationships?  (eg. Me!text1 vs Me.text1)

I am currently using the '.' notation exclusively (for code completion
in the VB Editor), but much of the high-quality code that I've seen
(in Duane Hookom's Query-by-Form db, for example) uses the other.


 0
4/6/2007 12:59:28 AM
comp.databases.ms-access 42670 articles. 0 followers.

4 Replies
1352 Views

Similar Articles

[PageSpeed] 54

Here's one opinion for you: http://doc.advisor.com/doc/05352

robert.waters wrote:
>Is there an advantage to using the '!' notation to represent form/
>control relationships?  (eg. Me!text1 vs Me.text1)
>
>I am currently using the '.' notation exclusively (for code completion
>in the VB Editor), but much of the high-quality code that I've seen
>(in Duane Hookom's Query-by-Form db, for example) uses the other.

--
HTH - RuralGuy (RG for short) acXP WinXP Pro
Please post back to this forum so all may benefit.

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/databases-ms-access/200704/1


 0
ruralguy
4/6/2007 1:32:37 AM
Here's my $0.02 worth on this. I tend to copy the notation style and naming conventions that I see being used in the Help files. That would be Me![text1] for a control on a form. I am of the belief that this notation explicitly refers to a control itself rather than a field in the form's recordset. Here's an example: I have a parts inventory app that uses a "Line" code, which is usually a 3-character abbreviation for a brand name, and is the name of both the field name and the bound text-box control on many of my forms. Because the word "Line" is one of those not-quite-a-reserved-word things ... so Access can get confused and pissy if I don't wrap it in square brackets. The "[Square Brackets]" format also allows for control names that may have spaces in them. (Not that I am in the habit of doing that.) Another benefit (to me anyway) is that I am so used to using this format that I do it by habit, so control references in my code really "stand out". Like you, I will often allow the supplied "." format from the code editor to get the spelling right (lazy), but then I go back and change it to the "bang and brackets" style before compiling. -- -- HTH, Don ============================= E-Mail (if you must) My.Name@Telus.net Disclaimer: Professional PartsPerson Amateur Database Programmer {:o) I'm an Access97 user, so all posted code samples are also Access97- based unless otherwise noted. ========================================================================== "robert.waters" <robert.waters@gmail.com> wrote in message news:1175821167.981097.263530@n76g2000hsh.googlegroups.com... > Is there an advantage to using the '!' notation to represent form/ > control relationships? (eg. Me!text1 vs Me.text1) > > I am currently using the '.' notation exclusively (for code completion > in the VB Editor), but much of the high-quality code that I've seen > (in Duane Hookom's Query-by-Form db, for example) uses the other. >   0 4/6/2007 2:12:19 AM I don't feel there's an advantage, just preference. Some feel the Intelisense is an advantage, but for me, I prefer refering to any control on a form, from that form, using the '!'. When refering to form controls from other modules, I think the '.' is a required method. I've also heard arguments about increased likelyhood of errors or corruption using one over the other, but I haven't come across that happening yet.   0 storrboy (404) 4/6/2007 3:41:31 AM On Apr 5, 10:12 pm, "Don Leverton" <leveriteNoJunkM...@telusplanet.net> wrote: > Here's my$0.02 worth on this.
> I tend to copy the notation style and naming conventions that I see being
> used in the Help files.
>
> That would be Me![text1] for a control on a form. I am of the belief that
> this notation explicitly refers to a control itself rather than a field in
> the form's recordset.
>
> Here's an example:
> I have a parts inventory app that uses a "Line" code, which is usually a
> 3-character abbreviation for a brand name, and is the name of both the field
> name and the bound text-box control on many of my forms. Because the word
> "Line" is one of those not-quite-a-reserved-word things ... so Access can
> get confused and pissy if I don't wrap it in square brackets.
>
> The "[Square Brackets]"  format also allows for control names that may have
> spaces in them. (Not that I am in the habit of doing that.)
> Another benefit (to me anyway) is that I am so used to using this format
> that I do it by habit, so control references in my code really "stand out".
>
> Like you, I will often allow the supplied "." format from the code editor to
> get the spelling right (lazy), but then I go back and change it to the "bang
> and brackets" style before compiling.
>
> --
> --
> HTH,
> Don
> =============================
> E-Mail (if you must) My.N...@Telus.net
>
> Disclaimer:
> Professional PartsPerson
> Amateur Database Programmer {:o)
>
> I'm an Access97 user, so all posted code samples are  also Access97- based
> unless otherwise noted.
>
> ==========================================================================
>
> "robert.waters" <robert.wat...@gmail.com> wrote in message
>
>
>
>
> > Is there an advantage to using the '!' notation to represent form/
> > control relationships?  (eg. Me!text1 vs Me.text1)
>
> > I am currently using the '.' notation exclusively (for code completion
> > in the VB Editor), but much of the high-quality code that I've seen
> > (in Duane Hookom's Query-by-Form db, for example) uses the other.- Hide quoted text -
>
> - Show quoted text -

IMHO one should NEVER name a control the same as a field in the
datasource.  Poor naming convention.  In fact in my convention, all
controls are prefixed with a 1 or 2 letters that describe the type of
control followed by the field name so that a text box that displays a
'reuse' a name.


 0
jebva (185)
4/6/2007 3:44:31 PM

Similar Artilces:

'is not' or '!='
A newbie question to you; what is the difference between statements like: if x is not None: and if x != None: Without any context, which one should be preferred? IMHO, the latter is more readable. On 2014-08-18 21:35, ElChino wrote: > A newbie question to you; what is the difference between statements > like: > if x is not None: > and > if x != None: > > Without any context, which one should be preferred? > IMHO, the latter is more readable. > "x == y" tells you whether x and y refer to objects that are equal. "x is y" tells you whether x and y actually refer to the same object. In the case of singletons like None (there's only one None object), it's better to use "is". "ElChino" <elchino@cnn.cn>: > A newbie question to you; what is the difference between statements > like: > if x is not None: > and > if x != None: Do the following: take two $10 bills. Hold one bill in the left hand, hold the other bill in the right hand. Now, the bill in the left hand "is not" the bill in the right hand. However, the bill in the left hand "==" the bill in the right hand. > Without any context, which one should be preferred? > IMHO, the latter is more readable. In almost all cases, both tests would result in the same behavior. However, the "is not" test is conceptually the correct one since you want... '^=' and '~='? Hello, What is the difference between '^=' and '~='? Thanks, Duckhye ... conventions/requirements for 'is' vs '==', 'not vs '!=', etc I'm wondering what is the canonical usage of the keywords 'is' and 'not' when you're writing conditionals and loops. The one I've been following is completely arbitrary--I use the symbols '==', '!=' for numerical comparisons and the words 'is', 'not' for everything else. Thanks in advance! On Mon, 19 May 2008 12:39:36 -0700, destroooooy wrote: > I'm wondering what is the canonical usage of the keywords 'is' and > 'not' when you're writing conditionals and loops. The one I've been > following is ... '''''''''''''The Running Update/Append Queries Using VBA code Ordeal'''''''''''''' Hello fellow programmers, I am trying to run an append/update query from code, a command button on a form initiates the queries. the format i am using is; _____________________________________________________ SELECT "criteria" FROM "criteria" WHERE "criteria" UPDATE/APPEND "field selections" RecordSource "qryExample" = above text strings" _______________________________________________________________________ When i am running a SELECT query in this manner it works fine with no problems, and accepts the values of specified linked for... '''''''''''''The Running Update/Append Queries Using VBA code Ordeal'''''''''''''' #2 Hi, Thanks for ur help there HJ. I know how to do the tasks you specified there. I would like for the update query to use field values from some of the fields on the form (frmInvoices) such as InvoiceNumber, DateFrom, DateTo. My problem is that an append/update query can't find the values in the open Form (frmInvoices) when I specify them as; [Forms]![frmInvoices]![InvoiceNumber] a select query has no problem finding the field values on a form. please help. Aaron Hi Aaron, Could you post the entire code that you are having trouble with? Now it is not possible to see what goes wrong. HJ "Aaron" <aaron@rapid-motion.co.uk> wrote in message news:260d7f40.0408120245.2f3d01f8@posting.google.com... > Hi, > > Thanks for ur help there HJ. > > I know how to do the tasks you specified there. > > I would like for the update query to use field values from some of the > fields on the form (frmInvoices) such as InvoiceNumber, DateFrom, > DateTo. My problem is that an append/update query can't find the > values in the open Form (frmInvoices) when I specify them as; > > [Forms]![frmInvoices]![InvoiceNumber] > > a select query has no problem finding the field values on a form. > > please help. > > Aaron First off, if you are not always using all the parameters specified in your form, then you have to add parameters to your query on the fly. Also, you can't just do something like qdf.SQL = "SE... if str_mo not in ('','.') and str_da not in ('','.') and str_yy not in ('','.') Any shorter ? Hi, there. =20 I'm just curious if it ever dawned on anybody how to abbreviate this line : if str_mo not in ('','.') and str_da not in ('','.') and str_yy not in ('','.')=20 =20 Igor Kurbeko Clinical Programmer Analyst 678 336 4328 ikurbeko@atherogenics.com =20 no brain no pain =20 how about: if not (str_mo in ('','.') or str_da in ('','.') or str_yy in ('','.')) OR if not (missing(str_mo) or missing(str_da) or missing(str_yy)) Eric On 22 Oct 03 21:13:37 GMT, ikurbeko@ATHER... Re: conventions/requirements for 'is' vs '==', 'not vs '!=', etc "inhahe" <inhahe@gmail.com> wrote in message news:... > >Ma: Symbolic identity is a mathematical relation >>Mb: Symbols are acausal >>m: Matter is causal >>C: Symbolic identity is not defined on matter. > I do think though that a computer languages claiming operations on 'identity', as vis a vis 'equivalence', is completely contrived, as in, it's just an arbitary distinction about the way in which we're going to compare bits. ... A function with 'and' , 'not' , 'null' , 'car' and 'cdr' What's this ? (defun enigma (x) (and (not (null x)) (or (null (car x)) (enigma (cdr x))))) "I suppose I should learn Lisp, but it seems so foreign." - Paul Graham, Nov 1983 On Wed, Oct 07 2015, CAI GENGYANG wrote: > What's this ? > > > (defun enigma (x) > (and (not (null x)) > (or (null (car x)) > (enigma (cdr x))))) Bad taste? It returns T if the list X contains nil as an element. It would be clearer to write (some #'null x). Helmut CAI GENGYANG ... Re: if str_mo not in ('','.') and str_da not in ('','.') and str_yy not in ('','.') Any shorter ? OR you could use ARRAY data new; set old; array igor$ (*) str_mo str_da str_yr; do over igor; if igor ~in (' ','.') then do; end; run; Prasad Ravi Igor Kurbeko <ikurbeko@ATHEROGENIC To: SAS-L@LISTSERV.UGA.EDU S.COM> cc: Sent by: "SAS(r) Subject: if str_mo not in ('','.') and str_da not in ('','.') and str_yy ...

Re: conventions/requirements for 'is' vs '==', 'not vs '!=', etc #2
"inhahe" <inhahe@gmail.com> wrote in message news:... > > "inhahe" <inhahe@gmail.com> wrote in message news:... >> >Ma: Symbolic identity is a mathematical relation >>>Mb: Symbols are acausal >>>m: Matter is causal >>>C: Symbolic identity is not defined on matter. >> > > I do think though that a computer languages claiming operations on > 'identity', as vis a vis 'equivalence', is completely contrived, as in, > it's just an arbitary distinction about the way in which we're goi...

error: expected '=', ',', ';', 'asm' or '__attrib
Hi I'm trying to compile an ADC Driver & come acrosss the following error. I've no experience writing drivers before, and hence have no clue how to fix it. Hope someone out there has encountered the problem & suggesst a fix for the same. The Error is I get is : qadc.c: At top level: qadc.c:97: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'qadc_read' make: *** [qadc.o] Error 1 [root@localhost qadc]# ########################################################################### ADC Driver Code ##...

error: expected '=', ',', ';', 'asm' or '__attrib
Hi I'm trying to compile an ADC Driver & come acrosss the following error. I've no experience writing drivers before, and hence have no clue how to fix it. Hope someone out there has encountered the problem & suggesst a fix for the same. The Error is I get is : qadc.c: At top level: qadc.c:97: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'qadc_read' make: *** [qadc.o] Error 1 [root@localhost qadc]# ########################################################################### ADC Driver Code ####################...

Difference between 'is' and '=='
Hey guys, this maybe a stupid question, but I can't seem to find the result anywhere online. When is the right time to use 'is' and when should we use '=='? Thanks alot~ mwql: >Hey guys, this maybe a stupid question, but I can't seem to find the >result anywhere online. When is the right time to use 'is' and when >should we use '=='? http://docs.python.org/ref/comparisons.html -- Ren� Pijlman mwql wrote: > Hey guys, this maybe a stupid question, but I can't seem to find the > result anywhere online. When is the right time to ...

'[OFF]' as in 'offensive'???
Hi, given that 'off-topicness' is indicated as '[OT]' and taking a look at those postings that started the threads indicated as '[OFF]' (which may both be seen as being somewhat offensive) may lead to the conclusion that '[OFF]' stands for offensiveness. I don't think that this is the intended meaning so what actually *does* '[OFF]' mean? I never came across that abbreviation before (although I have been around on the USENET for quite some time) but maybe it is worth knowing? Josef 'Jupp' Schugt NOTE: mails >100 KiB ...

Replacing ',' with '.'
Hello, I have a huge amount of numbers in a .txt file. The numbers are in the form 2,43252e+1. I need to replace the , with . How should I do this? I'd prefer some import method that does this during the import procedure. -Janne Hi, I guess you import the data as text and convert it then to numbers. Try 'strrep' before you convert the text to numbers. Tobias Jake the Snake schrieb: > Hello, > > I have a huge amount of numbers in a .txt file. The numbers are in the form 2,43252e+1. I need to replace the , with . How should I do this? I'd prefer some import method...

logical to 'on' / 'off'
Hi, is there a function implemented doing this conversion? my Problem is, that I want to use the following code: set(handles.edit_curr_trq_sl,'Enable',get(hObject,'Value')) where get(hObject,'Value') gives the state of a checkbox thank you! function [str]=tf2oo(logic) switch logic case 0 str='off'; case 1 str='on'; end%switch end%function tf2oo() while i do not know a built in function, I use my own:) meisterbartsch wrote: > > > function [str]=tf2oo(logic) > switch logic > case 0 > str='off'; &g...

replacing '/' with '\\'
I have a MKS ksh shell script running on a Windows box. In some scripts I have to convert a UNIX filename into a DOS filename, that is replace the '/' with '\\'. For example, replace /opt/siips/archive/text.dat with \\opt\\siips\\archive\\text.dat. I've tried using sed like $FILE='echo$FILE|sed "s/\//\\\/g"' which got me \opt\siips\archive\text.dat. It's close but I still need the second \. Does anyone have any suggestion? Or tell me where I've gone wrong? Thanks -- Steffen On 9 Dec 2004 20:14:21 -0800, sajohn52@yahoo.com <sajohn52@yahoo....

replacement for '{' and '}' ?
I am still playing around with what kind of syntax I would like to mark up my documents. Are there equivalent long substitutes for { and } when they are not used to describe arguments to functions? Something like \begin{group} and \end{group}. In other words, if I could force myself to write, say, \begin{group} \it ... \end{group} instead of {\it ... }, then I believe I could identify from the markup context what is an argument that belongs to a just invoked macro and what is text. {Of course, in this context, \textit{...} would be better.} No more ambiguity whether a in \myfunction{a} i...

Diff between '{..}' and {'..'}
Hi, Could anyone tell me the difference between ......| awk '{.......}' AND ......| awk {'......'} And also when(in what situation) these are used? Thanks in advance, Anil. 2005-01-12, 22:37(-08), Anil: > Hi, > > Could anyone tell me the difference between > > .....| awk '{.......}' > > AND > > .....| awk {'......'} > > > And also when(in what situation) these are used? > Thanks in advance, [...] The second one should never be used. The difference is at the shell level, not at the awk level. '...' are stro...

Meaning of ':' and '{}'
Hi, Please, can anyone tell me what is meaning of predicates ':' and '{}' ? ---------------- yours Advait Advait wrote: > Hi, > Please, can anyone tell me what is meaning of predicates ':' and '{}' > ? It depends on the context. : is used for module qualification of predicates. Like lists:member(X,L) The curly brackets are used in Definite Clauses Grammars: find the section on DCGs in the manual or google for it and you will find out easily. There are uses of {} as a functor in datastructures also. Cheers Bart Demoen Hello everyone,...

Re: '^=' and '~='?
Duckhye, According to the doc ( http://xrl.us/befwjx ) they, and one other set of characters, and the mnemonic 'NE' all represent 'NOT EQUAL'. Art ------- On Wed, 11 Feb 2009 16:52:40 -0600, Duck-Hye Yang <dyang@CHAPINHALL.ORG> wrote: >Hello, >What is the difference between '^=' and '~='? > >Thanks, >Duckhye ...

Does '!=' equivelent to 'is not'
I'm a bit confusing about whether "is not" equivelent to "!=" if a != b: ... if a is not b: ... What's the difference between "is not" and "!=" or they are the same thing? pirata wrote: > I'm a bit confusing about whether "is not" equivelent to "!=" > > if a != b: > ... > > if a is not b: > ... > > > What's the difference between "is not" and "!=" or they are the same thing? No, they are not the same thing. == and != test to see if the *value* of two variables are the same. Like so: >>> a = 'hello world' >>> b = 'hello world' >>> a == b True a and b both have the value of 'hello world', so they are equal is and is not, however, do not test for value equivalence, they test for object identity. In other words, they test to see if the object the two variables reference are the same object in memory, like so: >>> a is b False a and b are assigned to two different objects that happen to have the same value, but nevertheless there are two separate 'hello world' objects in memory, and therefore you cannot say that a *is* b Now look at this: >>> c = d = 'hello world' >>> c == d True >>> c is d True In this case, they are again the same value, but now the is test also shows that they are the same *object* as well, because...

Override 'and' and 'or'
Is it possible to override 'and' and/or 'or'? I cannot find a special method for it... __and__ and __rand__ and __or__ and __ror__ are for binary manipulation... any proposals? Have marvelous sunday, Marco Dekker <m.aschwanden@gmail.com> wrote: > Is it possible to override 'and' and/or 'or'? I cannot find a special > method for it... __and__ and __rand__ and __or__ and __ror__ are for > binary manipulation... any proposals? If you want to customize the truth value testing you have to implement __nonzero__ " __nonzero__( self) Call...

'a'..'z'
Is it possible to achieve something like this? switch (mystring.charAt(0)) { case 'a'..'z': // do something break; } "cruster" <cruster@gmail.com> wrote in message news:1151319731.988814.326200@m73g2000cwd.googlegroups.com... > Is it possible to achieve something like this? > > switch (mystring.charAt(0)) { > case 'a'..'z': > // do something > break; > } > There are times when an if statement may be more appropriate ;) Sorry - java is not VB :) -- LTP :) cruster schreef: > Is it possible to achieve somethi...

Web resources about - '!' vs. '.' - comp.databases.ms-access

Resources last updated: 2/27/2016 11:12:34 AM