Question on Expressions

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Could someone please explain the use of ! in an expression. I'm a beginner
and I don't know what this means or how to use it. Thanks
 
Hi, Regi.

!, called the Bang operator, is used to delimit, or separate an object from
its parent Collection. A period, called the Dot operator, separates an
object from its properties and methods. Refer to any good Access or VBA
reference for an explanation of Access' Collections, Objects, Properties and
Methods. The hierarchy of these items is referred to as the application's
Object Model.

For example, Forms is the collection of all open forms, while any particular
open form is an object and member of this collection. To refer to a specific
property of a specific form, the syntax of the reference is:

Forms![YourFormNameHere].YourFormProperty

For a control on the form:

Forms![YourFormNameHere]![YourControlName]

Brackets are used to enclose the object name. If the name has no spaces,
they are optional, although many developers use them anyway for clarity.

Access also provides a shortcut for the current form, that can be used in
VBA procedures, but for some reason not in ControlSource expressions. The
above control reference could also be:

Me![YourControlName]

Hope that helps.
Sprinks
 
Thanks you Sprinks. Could you recommend a good ACCESS reference. I'm trying
to learn this on my own and I'm having a hard time with some of the concepts.
It's frustrating becasue I'm good at Excel but I'm really struggling with
ACCESS.

Sprinks said:
Hi, Regi.

!, called the Bang operator, is used to delimit, or separate an object from
its parent Collection. A period, called the Dot operator, separates an
object from its properties and methods. Refer to any good Access or VBA
reference for an explanation of Access' Collections, Objects, Properties and
Methods. The hierarchy of these items is referred to as the application's
Object Model.

For example, Forms is the collection of all open forms, while any particular
open form is an object and member of this collection. To refer to a specific
property of a specific form, the syntax of the reference is:

Forms![YourFormNameHere].YourFormProperty

For a control on the form:

Forms![YourFormNameHere]![YourControlName]

Brackets are used to enclose the object name. If the name has no spaces,
they are optional, although many developers use them anyway for clarity.

Access also provides a shortcut for the current form, that can be used in
VBA procedures, but for some reason not in ControlSource expressions. The
above control reference could also be:

Me![YourControlName]

Hope that helps.
Sprinks



Regi said:
Could someone please explain the use of ! in an expression. I'm a beginner
and I don't know what this means or how to use it. Thanks
 
Regi,

I'm not current on beginner and intermediate references, but I imagine there
are many on the Newsgroup who can help you. By far the most valuable
reference that I've bought is the Access Developer's Handbook by Litwin,
Getz, and Gilbert--clear, crisp writing, excellent technical insights,
examples, and code, including a CD. It is, however, written for the
intermediate to advanced developer.

I can, however, suggest that your Access learning curve will be much more
pleasant and swift if you learn the following technical areas:

Relational Database Design and Table Normalization
This is perhaps the most important topic in using Access, because without a
clear understanding of the relational model, you will be banging your head
into a brick wall. At its most basic level, think "Things" (tables),
"Attributes" (fields), and "Relationships" (how one table is related to
another).

Do not duplicate fields from one table to another with the sole exception of
a "foreign key", a field that corresponds to another table's primary key.
For example, an Orders table should have the foreign key "CustomerID", but
NOT the customer name, address, or any other field that is already determined
in the Customer table. Information from related tables is pulled together
for display on a form or in a report by defining queries or using a master
and subform.

Also, do not store the result of a calculation. An Orders detail table
should have a UnitPrice and a Qty field, but the Extd (UnitPrice*Qty) should
be calculated on-the-fly in a calculated query field.

Events: What They Are and How You Can Use Them
Programming in Access consists primarily of event procedures, which are run
in response to an "event". There are many, many events that enable you to
provide a great deal of control to your application.

Form Controls
One prevalent misunderstanding among newbies is that a form doesn't have any
"fields". *Tables* have fields, which each have their own data type--Text,
Number, Date/Time, etc.. Forms have *controls*--textboxes, combo boxes,
option groups, lines, labels, etc. Some controls *may* be bound to a field
in the form's underlying recordset (that is, its ControlSource property is
set to the name of the field), in which case data entered into the control is
saved in the corresponding field. However, they can also be unbound, and
either be a blank placeholder for temporary data, or be used to display the
result of a calculation.

Learn the VBA Object Model
VBA is actually very straightforward and cohesive once you understand how it
uses objects, collections, methods, and properties--collectively called the
application's Object Model.

Use the Wizards to Create Code and Study the Result
This is a great way to learn VBA by demonstrating the required code needed
to accomplish an action you're already familiar with. Similarly, study the
forms and code behind them in the sample Northwind database (Help, Sample
Databases).

Until you purchase a reference, you can find information on some of these
basics at:

"Understanding Relational Database Design" Document Available in Download
Center:
http://support.microsoft.com/?id=283698
http://support.microsoft.com/?id=164172

ACC2000: "Understanding Relational Database Design"
http://support.microsoft.com/?id=234208

Fundamentals of Relational Database Design:
http://support.microsoft.com/?id=129519

Database Deisgn Principles:
http://msdn.microsoft.com/library/en-us/dndbdes/html/ch04DDP.asp

Naming Conventions:
http://www.xoc.net/standards/rvbanc.asp

http://www.eade.com/AccessSIG/downloads.htm
(See the last download titled "Understanding Normalization")

http://www.oreilly.com/catalog/accessdata3/chapter/ch04.html

http://www.datatexcg.com/Downloads/DatabaseDesignTips1997.pdf

Database Normalization Tips by Luke Chung
http://www.fmsinc.com/tpapers/genaccess/databasenorm.html

Support WebCast: Database Normalization Basics
http://support.microsoft.com/default.aspx?scid=/servicedesks/webcasts/wc060600/wcblurb060600.asp
Concepts Of Database Design And Management:
http://www.sitepoint.com/article/database-design-management

Database Deisgn And Normalization (aimed at dBase, but still valid):
http://www.jpmartel.com/bu12_c.htm

Conceptual Database Design:
http://www.sbpa.csusb.edu/flin/info609/dbdesign/Default.htm

Database Normalization:
http://burks.bton.ac.uk/burks/foldoc/35/28.htm

5 Rules of Database Normalization:
http://www.datamodel.org/NormalizationRules.html

And, of course, make judicious use of the Newsgroup. Frequently, the
quickest route to an answer is doing an initial Search or past posts by your
topic. If you're having a problem, it's likely someone before you had the
same one.

Hope that gets you started.
Sprinks

Regi said:
Thanks you Sprinks. Could you recommend a good ACCESS reference. I'm trying
to learn this on my own and I'm having a hard time with some of the concepts.
It's frustrating becasue I'm good at Excel but I'm really struggling with
ACCESS.

Sprinks said:
Hi, Regi.

!, called the Bang operator, is used to delimit, or separate an object from
its parent Collection. A period, called the Dot operator, separates an
object from its properties and methods. Refer to any good Access or VBA
reference for an explanation of Access' Collections, Objects, Properties and
Methods. The hierarchy of these items is referred to as the application's
Object Model.

For example, Forms is the collection of all open forms, while any particular
open form is an object and member of this collection. To refer to a specific
property of a specific form, the syntax of the reference is:

Forms![YourFormNameHere].YourFormProperty

For a control on the form:

Forms![YourFormNameHere]![YourControlName]

Brackets are used to enclose the object name. If the name has no spaces,
they are optional, although many developers use them anyway for clarity.

Access also provides a shortcut for the current form, that can be used in
VBA procedures, but for some reason not in ControlSource expressions. The
above control reference could also be:

Me![YourControlName]

Hope that helps.
Sprinks



Regi said:
Could someone please explain the use of ! in an expression. I'm a beginner
and I don't know what this means or how to use it. Thanks
 
Sprinks,

Thank you so much for taking the time to give me all of the web sites I can
go to for help and the information you gave me. I do come on this site and
read other peoples questions to gain from their experiences too. This is such
a helpfull place to come.

Regi

Sprinks said:
Regi,

I'm not current on beginner and intermediate references, but I imagine there
are many on the Newsgroup who can help you. By far the most valuable
reference that I've bought is the Access Developer's Handbook by Litwin,
Getz, and Gilbert--clear, crisp writing, excellent technical insights,
examples, and code, including a CD. It is, however, written for the
intermediate to advanced developer.

I can, however, suggest that your Access learning curve will be much more
pleasant and swift if you learn the following technical areas:

Relational Database Design and Table Normalization
This is perhaps the most important topic in using Access, because without a
clear understanding of the relational model, you will be banging your head
into a brick wall. At its most basic level, think "Things" (tables),
"Attributes" (fields), and "Relationships" (how one table is related to
another).

Do not duplicate fields from one table to another with the sole exception of
a "foreign key", a field that corresponds to another table's primary key.
For example, an Orders table should have the foreign key "CustomerID", but
NOT the customer name, address, or any other field that is already determined
in the Customer table. Information from related tables is pulled together
for display on a form or in a report by defining queries or using a master
and subform.

Also, do not store the result of a calculation. An Orders detail table
should have a UnitPrice and a Qty field, but the Extd (UnitPrice*Qty) should
be calculated on-the-fly in a calculated query field.

Events: What They Are and How You Can Use Them
Programming in Access consists primarily of event procedures, which are run
in response to an "event". There are many, many events that enable you to
provide a great deal of control to your application.

Form Controls
One prevalent misunderstanding among newbies is that a form doesn't have any
"fields". *Tables* have fields, which each have their own data type--Text,
Number, Date/Time, etc.. Forms have *controls*--textboxes, combo boxes,
option groups, lines, labels, etc. Some controls *may* be bound to a field
in the form's underlying recordset (that is, its ControlSource property is
set to the name of the field), in which case data entered into the control is
saved in the corresponding field. However, they can also be unbound, and
either be a blank placeholder for temporary data, or be used to display the
result of a calculation.

Learn the VBA Object Model
VBA is actually very straightforward and cohesive once you understand how it
uses objects, collections, methods, and properties--collectively called the
application's Object Model.

Use the Wizards to Create Code and Study the Result
This is a great way to learn VBA by demonstrating the required code needed
to accomplish an action you're already familiar with. Similarly, study the
forms and code behind them in the sample Northwind database (Help, Sample
Databases).

Until you purchase a reference, you can find information on some of these
basics at:

"Understanding Relational Database Design" Document Available in Download
Center:
http://support.microsoft.com/?id=283698
http://support.microsoft.com/?id=164172

ACC2000: "Understanding Relational Database Design"
http://support.microsoft.com/?id=234208

Fundamentals of Relational Database Design:
http://support.microsoft.com/?id=129519

Database Deisgn Principles:
http://msdn.microsoft.com/library/en-us/dndbdes/html/ch04DDP.asp

Naming Conventions:
http://www.xoc.net/standards/rvbanc.asp

http://www.eade.com/AccessSIG/downloads.htm
(See the last download titled "Understanding Normalization")

http://www.oreilly.com/catalog/accessdata3/chapter/ch04.html

http://www.datatexcg.com/Downloads/DatabaseDesignTips1997.pdf

Database Normalization Tips by Luke Chung
http://www.fmsinc.com/tpapers/genaccess/databasenorm.html

Support WebCast: Database Normalization Basics
http://support.microsoft.com/default.aspx?scid=/servicedesks/webcasts/wc060600/wcblurb060600.asp
Concepts Of Database Design And Management:
http://www.sitepoint.com/article/database-design-management

Database Deisgn And Normalization (aimed at dBase, but still valid):
http://www.jpmartel.com/bu12_c.htm

Conceptual Database Design:
http://www.sbpa.csusb.edu/flin/info609/dbdesign/Default.htm

Database Normalization:
http://burks.bton.ac.uk/burks/foldoc/35/28.htm

5 Rules of Database Normalization:
http://www.datamodel.org/NormalizationRules.html

And, of course, make judicious use of the Newsgroup. Frequently, the
quickest route to an answer is doing an initial Search or past posts by your
topic. If you're having a problem, it's likely someone before you had the
same one.

Hope that gets you started.
Sprinks

Regi said:
Thanks you Sprinks. Could you recommend a good ACCESS reference. I'm trying
to learn this on my own and I'm having a hard time with some of the concepts.
It's frustrating becasue I'm good at Excel but I'm really struggling with
ACCESS.

Sprinks said:
Hi, Regi.

!, called the Bang operator, is used to delimit, or separate an object from
its parent Collection. A period, called the Dot operator, separates an
object from its properties and methods. Refer to any good Access or VBA
reference for an explanation of Access' Collections, Objects, Properties and
Methods. The hierarchy of these items is referred to as the application's
Object Model.

For example, Forms is the collection of all open forms, while any particular
open form is an object and member of this collection. To refer to a specific
property of a specific form, the syntax of the reference is:

Forms![YourFormNameHere].YourFormProperty

For a control on the form:

Forms![YourFormNameHere]![YourControlName]

Brackets are used to enclose the object name. If the name has no spaces,
they are optional, although many developers use them anyway for clarity.

Access also provides a shortcut for the current form, that can be used in
VBA procedures, but for some reason not in ControlSource expressions. The
above control reference could also be:

Me![YourControlName]

Hope that helps.
Sprinks



:

Could someone please explain the use of ! in an expression. I'm a beginner
and I don't know what this means or how to use it. Thanks
 
Back
Top