Solved

probably simple question

Posted on 2002-03-21
8
175 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
 
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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 69

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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
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…

757 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now