References?

  • Thread starter Thread starter SusanJ
  • Start date Start date
S

SusanJ

I am a relatively new Access user, so I check the Access
newsgroups regularly for tips and info...I have learned a
lot just reading the questions and solutions! Anyway, now
I have a question...

I see a number of questions regarding "References". I
looked it up in the Help section of my application, and
the information was written as though I had a clue as to
what they were talking about! However, I don't! Can
someone explain in plain English what the heck a reference
is and how/why it may be used?

Thanks for all your help in the past, and more in advance
for this question.
 
Hi there,

A reference is very much the same thing that a short-cut on your
desktop is.

The short-cut on your desktop is a reference to another object.
It is NOT the object itself. For instance, you can create a
short-cut to a program, and you will notice that the actual program
itself is in one place, and the short-cut can be in the same folder or
another folder. And you can move the short-cut anywhere you like
and use it to start up the program it is referring to.

You can delete the short-cut as well to get rid of clutter and it will
not affect the program at all, you'll just have one less "reference"
to the program (or one less short-cut).

In a database, you can create a database to another table, and this
is typically called a linked table, but it IS a reference. This is NOT
to be confused with the process of linking tables to create
relationships, and I myself get confused I see people asking
questions about linked tables, because you have to wonder if they
are talking about the relationship between two tables, or about a
physically linked table. The physically linked table is just a pointer
to another table, and if you DELETE the physical linkage, you
do NOT delete the table, just the reference to the table is
deleted.

Programmers use references all the time. When you create a form
it is typically given the name Form1. This is just a reference to a
form class object, and while it is and can be a physical object, it
really in the end is what is called an instantiated class object. Once
it is instantiated, it exists. I'm explaining this, because the word
"reference" doesn't always mean a separate short-cut that, but
in this case becomes the object.

So when programmers are talking about references, there can
be a couple meanings that are slightly different from each other.

It is really just a concept, of using pointers to get to an object.
To illustrate this a little better, say you've created a form with
a listbox on it. The programming language will (in this case the
language would be VBA or VBScript) hold references to the
form. The form is referred to through it's reference (ie the
name of the form). The listbox on the form has a name as
well and can be referred to by it's name or by what's called
a fully qualified reference or a fully qualified name.

Form1.ListBox1

The items in the ListBox can be selected and the information
contained within can be queried, or extracted, via a reference
to the particular item in the listbox...

Form1.ListBox1.Items(n).Text

where n is a 0-based number representing a certain position
in the list of items, and the .Text means you want to extract
the information from it. So .Text is a reference to the contents
contained within the ListBox at the n'th position.

Hope that helps!

Have fun!

--
Jim Carlock
http://www.microcosmotalk.com/
Post replies to the newsgroup.


:
I am a relatively new Access user, so I check the Access
newsgroups regularly for tips and info...I have learned a
lot just reading the questions and solutions! Anyway, now
I have a question...

I see a number of questions regarding "References". I
looked it up in the Help section of my application, and
the information was written as though I had a clue as to
what they were talking about! However, I don't! Can
someone explain in plain English what the heck a reference
is and how/why it may be used?

Thanks for all your help in the past, and more in advance
for this question.
 
Susan

Do you recall the steps needed to a) replace your vehicle's oil & filter;
b) prepare a 5-course dinner around an entrée of Chicken Cordon Bleu; c)
calculate a standard deviation?

If, like most folks, these are not at the top of your mind, you'll refer to
some other source to remind yourself.

References are like that ... instead of stuffing every bit of information
that might be needed into Access, the folks at Microsoft provided a
mechanism to refer to those additional, but not needed every day,
collections of objects, calculations, etc. (this is my take on it --
Microsoft will correct me if I mis-stated it, I'm sure!).

Plus, this approach has the advantage of allowing for NEW objects,
calculations, etc. to be created and accessed by Access, via References.
 
I am a relatively new Access user, so I check the Access
newsgroups regularly for tips and info...I have learned a
lot just reading the questions and solutions! Anyway, now
I have a question...

I see a number of questions regarding "References". I
looked it up in the Help section of my application, and
the information was written as though I had a clue as to
what they were talking about! However, I don't! Can
someone explain in plain English what the heck a reference
is and how/why it may be used?

Thanks for all your help in the past, and more in advance
for this question.



The short of it is that he Libraries contain the functions and other
files that are needed to run your database.

Sometimes Access can't find where you have placed one of the libraries
it needs and therefore it can't compile the code needed. Think of it
as you having misplaced one of several telephone books that you might
need in the course of the day. When this occurs, it will raise an
Error and mark a Library as 'MISSING'.

For the long of it, see Doug Steele's article at:
http://members.rogers.com/douglas.j.steele/AccessReferenceErrors.html
 
Jim and Jeff, my thanks! I may have to take some time to
digest everything, but at least now I have an idea of what
the term means. I appreciate your responses!

Susan
 
I don´t know if I´m the right person to answere this Q but I´ll give it a
try anyway.

The way I have understod it a reference is a shortcut to a module of code
which holds one or several functions that the program can use.

Let´s say that you write some code which you put in a code module (in
Access). Let´s say that your code calculate sqarerot for an integer. You
call your function "Sqarerote". Each time you want to calculate squarerot
you call this function. So far everything is straight forward.

But lets say that you put your code in another accessfile. How does your
code, from where you want to calculate the squarerot know WHERE to get this
function???

The reference´s that you where asking about is more or less the path to the
function needed. You could say that it´s like an index in a book telling the
program WHERE to find the functions needed.

Maby my example with squarerot whasn´t to good because I actually don´t know
if this is possible in access, to but a codemodule in another mdb-file!?

Anyway this was the way I have understod this with references!

// Niklas
 
My initial comments were providing abstract but an easy to
understand introduction to a lot of different meanings as to what
references are. Someone else in the set of messages explained
about Libraries, and he was thinking along the lines of References
inside of VBA. I had totally neglected that and I'm going into that
now. ;-)

To get to the Microsoft Access form of Help for References,
click on Tools, Click on Macro, then click on Visual BASIC
Editor.

Once that Editor opens up, Click on Tools, Click on References.
There is a help button there.

I had completely forgotten about that section, but it's used when
you are putting VBA code into place.

If you look through that list of items there, take your time, because
their is a huge list there. You will see that they are referring to
certain files, most of which are located in the C:\Windows\System32
folder. When you put a check mark into the box, the code for that
library becomes available for use within your application.

Another thing I forgot to mention, is that all in all, all references are
just POINTERS to something else. I always think of a reference
as a pointer, and if you do any C programming at all, they don't
call anything references, they call them pointers. ;-) In C, you
gain access to public routines in an object, by grabbing a pointer
to an object. Or you can access libraries of helpful routines, by
using pointers to certain functions, procedures, classes, and data
types.

This is done in Visual BASIC as well, and you'll see a lot of API
calls done in Visual BASIC that return a Long variable (or an
Integer if you are using one of the .Net languages). For instance,
Form1.HWnd returns a handle to a form and you can do things
with that form by using it's handle and using certain API calls on
it.

If you have any other questions please post one here. Especially
if it deals with References and / or pointers or external function
calls, etc.

--
Jim Carlock
http://www.microcosmotalk.com/
Post replies to the newsgroup.


:
Jim and Jeff, my thanks! I may have to take some time to
digest everything, but at least now I have an idea of what
the term means. I appreciate your responses!

Susan
 
I think the other two responders missed the simple
explanation. If you open a module for editing, click on
Tools and References, you are presented with a list of
object libraries. Depending on the needs of your
application, you will need to select certain libraries.
Most, if not all, of the posts I see here that speak
of 'References' are talking about this.
 
Back
Top