Hi aCK!,
It looks like you're trying to track session info, in which case you need a 1-to-many relationship
established between your User table and your SessionDetails table.
In general, you establish a relationship between two tables by creating a foreign key constraint.
First, both of your tables need primary keys defined.
Second, create a forign key constraint by placing a copy (name and data type) of the primary key field of the table on the "one" side of your relationship (Users) in the table on the many side of your relationship (SessionDetails).
Third, create a join between the primary key field of the Users table and the foreign key field in
the SessionDetails table. You can do that in the Access Relationships window. Just drag-and-drop.
Here's the table structures:
Table: tblUsers
------------------
Field: UserID [PrimaryKey]
Type: Number
Field: UserName
Type: Text
Table: tblSessionDetails
------------------------
Field: SessionID [PrimaryKey]
Type: AutoNumber
Field: UserID [ForeignKey]
Type: Number
Field: SessionDateTime
Type: Date/Time
Field: Desc
Type: Text
Field: Misc
Type: Text
Then to get a resutset of session info, use a query like:
SELECT tblUsers.UserID, tblUsers.UserName, tblSessionDetails.SessionDateTime, tblSessionDetails.Desc, tblSessionDetails.Misc
FROM tblUsers INNER JOIN tblSessionDetails ON tblUsers.UserID = tblSessionDetails.UserID;
Also, avoid using Date/Time as a field name since it is an Access data type name.
HTH,
Bob
|