ak said:
... I want to know data type in both tables'
primary key and foreign key should be matched?
You can create a relationship or a join in a Query between some different
data types (for example, a Long Integer* and an Integer). But to specify
referential integrity, the data types must be the same (for example, a Long
Integer must be paired with a Long Integer).
The Query Builder will let you join a Long Integer to a Text Field, and will
let you save that Query, but when you attempt to execute it, you will get a
"Data type mismatch" error.
* Note that an AutoNumber is the same data type as Long Integer, but
automatically populated.
I don't understand what you are asking. If you clarify, someone will try to
explain.
What is single, double, integer, long integer?
A newsgroup is an inappropriate place to expect, or to offer, a basic
tutorial on data types. Also, every version of Access has included a Help
file, and though the Help files have been of varying quality, they have all,
every one, had a definition of "data types". However, if you need that
explained, chances are that you need some very basic training. Here are some
suggestions:
In today's homepage* at
http://office.microsoft.com/ along the bottom,
you'll see links by subject. Click on the one entitled "Office training
courses", under the heading "Training". That will take you to a page
entitled "Training" and aproximately in the middle of the page, you'll see
two headings "Browse 2007 Office Courses" and "Browse 2003 Office
Courses" -- pick the appropriate one (use 2003 for any version previous to
2007), and click the entry for Access 2007 or Access 2003. I chose Access
2003, which leads to a list of 18 Access 2003 courses at the beginning and
intermediate levels -- I've heard very good feedback from people at those
levels who used them. (I wouldn't be a good judge as I passed those levels
in Access' early days.)
The Access 2007 product has a much-changed user interface, and while most of
the underlying information in the Access 2003 courses will still apply, the
"how-to-use" instructions will be useless with Access 2007. So for Access
2007, on the Training Page, choose Access 2007. There are only 9 courses
available, so far, for Access 2007, but they'll give you a good start.
Self-study texts are another source:
Microsoft Access xxxx Step by Step, from Microsoft Press, is a good start
for the raw novice or casual end-user.
Using Microsoft Access xxxx - Special Edition, by Roger Jennings, published
by Que, starts from the beginning and goes deeper than some "beginner books"
Access 2003 Inside Out, by John Viescas, and Access 2007 Inside Out, by John
Viescas and Jeff Conrad, from Microsoft Press, are good books with thorough
coverage, and also go deeper than most.
Microsoft Access xxxx Developer's Handbook, by Litwin, Getz, et al,
published by Sybex, is "The Book" that Access Developers covet.
Unfortunately, no new edition has been published since the 2002 edition;
fortunately, the information in the 2002 edition (in two volumes) applies
almost entirely to 2003 as well, and much of it to previous versions.
* in all the above "xxxx" represents the version of Microsoft
Access and/or the edition of the book
There's a list of useful resources (websites, many with examples) on my user
group's page at
http://sp.ntpcug.org/accesssig/default.aspx.
These will give you enough reading for quite a while and if you really learn
everything in these, you'll have a very good understanding.
Larry Linson
Microsoft Office Access MVP