1

Possible Duplicate:
Bang Notation and Dot Notation in VBA and MS-Access

What is the difference between Recordset!ID and Recordset.ID in VBA?

Community
  • 1
  • 1
Pablo
  • 28,133
  • 34
  • 125
  • 215

1 Answers1

2

This has been answered many, many times. Just Google dot vs. bang.

It took a second to come up with these links.

http://blogs.office.com/b/microsoft-access/archive/2008/05/30/dot-or-bang.aspx

http://rogersaccessblog.blogspot.com/2009/04/bang-vs-dot-in-dao.html

Jonathan Wood
  • 65,341
  • 71
  • 269
  • 466
  • 2
    While references are good to back up your answer, the actual answer should be in the answer itself. StackOverflow should stand alone, external links can move, get deleted, get edited, etc. (And for the basic thrust of the answer, the reader shouldn't have to follow through to a blind link.) – T.J. Crowder Apr 22 '11 at 17:46
  • IMO, `Recordset.ID` is not the same as `Recordset!ID`. I don't think the code will compile when using `Recordset.ID`. – shahkalpesh Apr 22 '11 at 17:51
  • 2
    @T.J. Crowder: Actually, my thinking behind this answer was that there are plenty of answers to this question if one is only willing to look. I've since clarified this point. – Jonathan Wood Apr 22 '11 at 17:59
  • @shahkalpesh: Sorry, I'm not sure who your comment was directed at or how it related to anything I posted. – Jonathan Wood Apr 22 '11 at 18:01
  • @Jonathan: It doesn't matter if it's been asked and answered elsewhere. If there's no duplicate here on SO, the question should be properly answered (or not answered at all, of course, you're free to ignore questions you think are silly or a waste of time). Remember that one of SO's goals is to be the top hit in a search, so... – T.J. Crowder Apr 22 '11 at 18:01
  • @T.J. Crowder: If you take exception to pointing out that the answer is all over the web if one is only willing to look, I'm afraid you'll take exception to others besides me as I see that sort of reply all the time. I've provided my thoughts, a couple of links, and the term the OP can use to search on his own. I would consider that helpful to anyone wanting an answer to the original question. – Jonathan Wood Apr 22 '11 at 18:03
  • @Jonathan: At **best**, it's a comment, not an answer. Other people doing it doesn't mean it the right thing to do, and just as you see others doing this, you also see others like myself flagging it up. – T.J. Crowder Apr 22 '11 at 18:06
  • @Jonathan: IMO, using `!` is a shortcut to writing `.Fields("fieldName")`, for recordset example. i.e. one could write `recordset!ID` in place of `recorset.Fields("ID")`, where `Fields` is a default property on recordset, which is a collection (or dictionary). If `!` can be used for `.`, all the fields in the recordset can be accessed using `.`. In that case, what happens if I have a field named `ChunkSize` (or any property of recordset)? i.e. what will following mean, when I write `recordset!ChunkSize` vs recordset!ChunkSize`, assuming `ChunkSize` is a property on the recordset. – shahkalpesh Apr 22 '11 at 19:00
  • @shahkalpesh: Okay, but I'm still not clear why this is directed at me. Do you feel it counters something I've said? Perhaps you should direct your comments to the OP. – Jonathan Wood Apr 22 '11 at 19:20