Solved

probably simple question

Posted on 2002-03-21
8
199 Views
Last Modified: 2010-05-02
I'm looking at some VB code at work that contains (among others) this piece:

With oRS
 If Not (.EOF And .BOF) Then
   Do While Not .EOF
   lTaskID = !TaskID
... etc.

My question: what in the world do the "!" mean in there?
0
Comment
Question by:gsn
  • 2
  • 2
  • 2
  • +2
8 Comments
 
LVL 18

Expert Comment

by:bobbit31
ID: 6885802
!TaskID means that TaskID is a field in the recordset (oRS)
0
 
LVL 18

Expert Comment

by:bobbit31
ID: 6885808
so basically ITaskID = the value of TaskID field
0
 
LVL 43

Accepted Solution

by:
TimCottee earned 50 total points
ID: 6885809
The ! syntax refers to the fields collection of the recordset, this could equally be represented as:

ITaskID = .Fields("TaskID").Value

It is recommended to use the full syntax as the ! syntax forces the code to evaluate the line then convert it internally as above and then get the result. However in reality the time taken to do this is very small and has little to no impact.
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
LVL 1

Author Comment

by:gsn
ID: 6885814
yeah, I understand that... sorry, should have made myself clear: what's the difference between "." and "!" in that regard.
0
 
LVL 3

Expert Comment

by:Bahnass
ID: 6885815
TaskID is a field in oRS Recordset

With oRS makes    !TaskID translated into
oRS!TaskID

Hope it is clear
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 6885816
the ! in this case is called the Bang operator.

you could have wrote:
lTaskID = .fields("TaskID").value
0
 
LVL 3

Expert Comment

by:Bahnass
ID: 6885826
Hi Tim again

No I'm abad typist !!!!
0
 
LVL 1

Author Comment

by:gsn
ID: 6885873
thanks for the prompt answer!!
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question