Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

rsPRCheck.Fields("earnings").VALUE Vs rsPRCheck!Earnings 2

Status
Not open for further replies.

steve728

Programmer
Mar 16, 2003
536
US
Has anyone had any problems using a field refereence of:
rsPRCheck.Fields("earnings").VALUE Vs rsPRCheck!Earnings?

All this time I have been using the long-hand version. Should I be aware of any short comings using the short version?

Steve
 
Not myself, I've never used the long hand,
except for using variables, in field names.

For x = 1 to 10
rec("txtDate" & x) = #3/3/06#
rec.Update
rec.Move...


....and yes, that's what I consider, "long version"(LOL).

Just for the record, YOUR long version, is
more often called "Explicit Referencing", as opposed to
"Implicit",
Because it makes reference to each object hierarchy,
before the control name.
 
You question compares apples to oranges. You addressed the use of Bang vs Dot and the use of default properties. Regardless if you use Bang or Dot notation, the default property for a field is "value" so you do not need value. The default value for a recordset is "Fields" collection so you do not need "fields"

So in Dot the following are equivalent:
rsPRCheck.Fields("Earnings").VALUE
rsPRCheck.Fields("Earnings")
rsPRCheck("Earnings")

In Bang the following are equivalent:
rsPRCheck.fields!Earnings.value
rsPRCheck.fields!Earnings
rsPRCheck!Earnings

So both notations have a shorthand. This will open a can of worms, but I believe that if you want to avoid corruption and make yourself clear use Dot notation and long hand. There is a good discussion by Litwin and Getz why Bang notation can lead to problems; however, most people use bang and shorthand. And many people will swear by it.

 
Thank you guys for replying so quickly. Laast night I tried to submit a star for Zion7 but the function is not working. I tried again right now for Zion7 and you but still no go. As soon as it's working again I will submit stars for sure!

Steve
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top