Tech Reviews, Guides, Articles, and Forums for PC Hardware, Modding, and Gaming Enthusiasts
Fury-Tech Forums

Go Back   Fury-Tech Forums > Software Forums > Programming and Coding

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-09-2004, 09:09 AM
Technophile's Avatar
Super Moderator
Great Diviner
 
Join Date: Sep 2002
Location: Everywhere
Posts: 3,811
Rep Power: 10
Technophile is on a distinguished road
Send a message via AIM to Technophile Send a message via MSN to Technophile Send a message via Yahoo to Technophile
Default Access VBA Question...

Probably a stupid question but I can't seem to find the answer. What's the difference between using this:

Me.Whatever

and this:

Me!Whatever

???
__________________
Your sig is cooler than mine.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 12-09-2004, 10:43 AM
jaysaul's Avatar
Greater Overmind
Greater Overmind
 
Join Date: Apr 2004
Location: Tucson, AZ
Posts: 753
Rep Power: 5
jaysaul is on a distinguished road
Default

In what context?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 12-09-2004, 11:07 AM
Technophile's Avatar
Super Moderator
Great Diviner
 
Join Date: Sep 2002
Location: Everywhere
Posts: 3,811
Rep Power: 10
Technophile is on a distinguished road
Send a message via AIM to Technophile Send a message via MSN to Technophile Send a message via Yahoo to Technophile
Default

Basically in regards to setting or checking the properties of a form or controls on a form.

For example, this page shows using . and ! in different combinations... http://www.mvps.org/access/forms/frm0031.htm

So far I've been using . for everything. I'm just wondering when I should be using ! and why.
__________________
Your sig is cooler than mine.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 12-09-2004, 11:15 AM
jaysaul's Avatar
Greater Overmind
Greater Overmind
 
Join Date: Apr 2004
Location: Tucson, AZ
Posts: 753
Rep Power: 5
jaysaul is on a distinguished road
Default

Try here:

http://searchnetworking.techtarget.c...213850,00.html
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 12-09-2004, 11:18 AM
Technophile's Avatar
Super Moderator
Great Diviner
 
Join Date: Sep 2002
Location: Everywhere
Posts: 3,811
Rep Power: 10
Technophile is on a distinguished road
Send a message via AIM to Technophile Send a message via MSN to Technophile Send a message via Yahoo to Technophile
Default

Nothing to do with the web. Just manipulating forms in Microsoft Access using Visual Basic for Applications. What I am doing now is working but I'm wondering if using the ! has something to do with supporting multiple simultaneous users? I'm just wondering what it does different from . .
__________________
Your sig is cooler than mine.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 12-09-2004, 03:37 PM
Technophile's Avatar
Super Moderator
Great Diviner
 
Join Date: Sep 2002
Location: Everywhere
Posts: 3,811
Rep Power: 10
Technophile is on a distinguished road
Send a message via AIM to Technophile Send a message via MSN to Technophile Send a message via Yahoo to Technophile
Default

Bump.
__________________
Your sig is cooler than mine.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 12-09-2004, 04:06 PM
Tekime's Avatar
Administrator
Great Diviner
 
Join Date: Aug 2002
Location: Maine
Posts: 5,248
Rep Power: 10
Tekime is on a distinguished road
Send a message via AIM to Tekime Send a message via MSN to Tekime Send a message via Yahoo to Tekime
Default

http://msdn.microsoft.com/library/de...ybex_chap6.asp

Quote:
Bang (!) versus Dot (.) versus Quotes ("")

The bang ("!") and dot (".") identifier operators help describe the relationships among collections, objects, and properties in an expression. They indicate that one part of an expression belongs to another.

In general, you follow the bang with the name of something you created: a form, report, or control. The bang also indicates that the item to follow is an element of a collection. You'll usually follow the dot with a property, collection, or method name. Actually, under the covers, the bang separator really says, "retrieve the following object from the default collection of the parent object." (See the section "Using Default Collections" later in this chapter.) For example, when working with forms, you can refer to a control on a form like this:

Set ctl = Forms("frmTest").Controls("txtName")

or, because Controls is the default collection of a form, you can abbreviate that as either of the following:

Set ctl = Forms("frmTest")("txtName")
Set ctl = Forms("frmTest")!txtName

You can also think of the uses of these operators this way: a bang (or parentheses and quotes) separates an object from the collection it's in (a field in a table, a form in the Forms collection, a control on a form), while a dot separates an object from a property, method, or collection of that object.

If you refer back to Table 6.2, you'll see that there's always an alternative to using the bang operator: you can use the parentheses and quotes syntax. For example, these two statements refer to exactly the same property:

cat.Tables!tblCustomers.Columns!Address.Type
cat.Tables("tblCustomers").Columns("Address").Type

It turns out that, behind the scenes, the former style of dot-and-bang reference is translated to the latter style of parentheses-and-quotes reference when you execute such a statement. This means that, although using the bang operator will save you a bit of typing, you'll pay for it in a speed penalty. Our recommendation, and the style we've followed throughout this book, is to always use the parentheses and quotes format for referring to a member of a collection unless it's absolutely necessary to use the bang operator. In addition, if the object to which you're referring contains spaces (or other nonstandard characters), you'll have to treat these names specially when using the bang syntax—you'll need to surround the name in square brackets. If you use the parentheses/quotes syntax, all names are treated equally.

WARNING One place where the bang operator is necessary is in query parameters that refer to form fields. That is, you cannot avoid the Forms!FormName!ControlName syntax in this case.

Tip It's a hard habit to break—we've been using "!" since Access 1. But the fact is, except in a very few places (query parameters is the one that comes to mind) you needn't ever use a bang and should probably think about weaning yourself from this syntax if you currently use it. It's important that you understand what it's doing and what it means when you see it, but we suggest you not use it in your VBA code.

Finally, one more reason to use "("")" rather than "!" in your code: when you use parentheses/quotes, you're using a string expression to identify an object. If you're using a string expression, you can just as easily use a string variable. Using this technique makes it possible to identify the object you want to work with at runtime, using a variable. This can be a useful technique, and we'll employ it throughout this book.
__________________
ABIT NF8 | Athlon 64 2800+ | 1GB Corsair XMS PC-3200 | MSI GeForce 6600GT

My blog, business, Twitter, ryze, LinkedIn, Digg, Facebook
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 12-09-2004, 04:53 PM
Technophile's Avatar
Super Moderator
Great Diviner
 
Join Date: Sep 2002
Location: Everywhere
Posts: 3,811
Rep Power: 10
Technophile is on a distinguished road
Send a message via AIM to Technophile Send a message via MSN to Technophile Send a message via Yahoo to Technophile
Default

Thanks, that clears it up. The only place I've used ! so far is in a query that references a form, so I guess I'm doing the right thing.

BTW, I've created an attendance tracking form for my employee db that I'd love your feedback on if you have the time.

Thanks again!
__________________
Your sig is cooler than mine.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 12-12-2004, 03:24 PM
Tekime's Avatar
Administrator
Great Diviner
 
Join Date: Aug 2002
Location: Maine
Posts: 5,248
Rep Power: 10
Tekime is on a distinguished road
Send a message via AIM to Tekime Send a message via MSN to Tekime Send a message via Yahoo to Tekime
Default

Cool, glad it helped.

I'd be happy to check out your new DB work. Things are crazy as hell, but if you want to send me over a ZIP I'll check it out when I get a chance.
__________________
ABIT NF8 | Athlon 64 2800+ | 1GB Corsair XMS PC-3200 | MSI GeForce 6600GT

My blog, business, Twitter, ryze, LinkedIn, Digg, Facebook
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 12-13-2004, 12:40 PM
Technophile's Avatar
Super Moderator
Great Diviner
 
Join Date: Sep 2002
Location: Everywhere
Posts: 3,811
Rep Power: 10
Technophile is on a distinguished road
Send a message via AIM to Technophile Send a message via MSN to Technophile Send a message via Yahoo to Technophile
Default

You've got mail!

Thanks again.
__________________
Your sig is cooler than mine.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Currently Viewing
Go Back   Fury-Tech Forums > Software Forums > Programming and Coding




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Access Question... progress indicator? Technophile Programming and Coding 5 03-18-2005 12:03 PM
Access Question - For the love of shit... Technophile General Software 5 02-09-2005 02:47 PM
Access Question - Wth? Technophile General Software 2 02-05-2005 10:26 PM
Access Question - maybe a bit weird... Technophile General Software 4 02-03-2005 08:12 AM
Access Question... Technophile General Software 13 11-11-2004 03:09 PM


All times are GMT -5. The time now is 10:03 PM.


PHP Scripts
BidVerve Directory
PageRank Script
SEO Scripts
37 SEO Scripts
List Cleaner Script
Keyword Cleaner
Directory Script
Directory Script

Directories
BidVerve Directory
BidVerve Directory
Nerve Directories
Nerve Directories
Directory Grow
Directory Grow

Our Supporters
entertainment sites
online casino

Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.1.0 ©2007, Crawlability, Inc.