Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

probably simple question

Posted on 2002-03-21
8
Medium Priority
?
221 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 200 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…
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…

963 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