G
google3luo359
I'm trying to find out if I have set up a couple of tables and
queries correctly.
My main table contains student data (studentnum, lastname, firstname,
grade)
A second table contains login info (studentnum, LoginDate and
Password).
First off I'd like to know whether I should include Password in the
main, second, or possibly its own table.
Students will only be logging into the db two or three times a year.
Many will elect not to set their password and just leave the field
blank, although they will be encouraged to set their own password to
safeguard their data.
I have created two queries to enter the LoginDate and Password and am
not sure whether they have been set up properly. After tweaking them a
bit, I finally got them to work.
Here's the login query:
UPDATE Students LEFT JOIN DatePass ON Students.StudNum =
DatePass.StudNum SET DatePass.StudNum = [Students]![StudNum],
DatePass.LogDate = Now()
WHERE ((([Forms]![frmPass]![cboStudNum])=[Students]![StudNum]));
And here's the password query:
UPDATE Students LEFT JOIN DatePass ON Students.StudNum =
DatePass.StudNum SET DatePass.StudNum = [Students]![StudNum],
DatePass.LogDate = Now(), DatePass.[Password] =
[Forms]![frmPassSet]![txtNewPass]
WHERE (((Students.StudNum)=[Forms]![frmPassSet]![cboStudNum]));
So they are both update queries, yet the DatePass table starts out
empty with no records.
As a student logs in a new record is created and the LogDate field is
'updated'.
When the student will log in a second time, then the LogDate field will
be truly updated.
Same for the Password field in DatePass.
So the queries function as both an Append and Update query. Is this
normal?
Also I couldn't get them to run properly until I set up a LeftJoin
between them.
I don't understand why it had to be set as a Many -to-One between
the Students table and the DatePass table, when there will never be a
many to one relationship.
Any help would be appreciated. Ric
queries correctly.
My main table contains student data (studentnum, lastname, firstname,
grade)
A second table contains login info (studentnum, LoginDate and
Password).
First off I'd like to know whether I should include Password in the
main, second, or possibly its own table.
Students will only be logging into the db two or three times a year.
Many will elect not to set their password and just leave the field
blank, although they will be encouraged to set their own password to
safeguard their data.
I have created two queries to enter the LoginDate and Password and am
not sure whether they have been set up properly. After tweaking them a
bit, I finally got them to work.
Here's the login query:
UPDATE Students LEFT JOIN DatePass ON Students.StudNum =
DatePass.StudNum SET DatePass.StudNum = [Students]![StudNum],
DatePass.LogDate = Now()
WHERE ((([Forms]![frmPass]![cboStudNum])=[Students]![StudNum]));
And here's the password query:
UPDATE Students LEFT JOIN DatePass ON Students.StudNum =
DatePass.StudNum SET DatePass.StudNum = [Students]![StudNum],
DatePass.LogDate = Now(), DatePass.[Password] =
[Forms]![frmPassSet]![txtNewPass]
WHERE (((Students.StudNum)=[Forms]![frmPassSet]![cboStudNum]));
So they are both update queries, yet the DatePass table starts out
empty with no records.
As a student logs in a new record is created and the LogDate field is
'updated'.
When the student will log in a second time, then the LogDate field will
be truly updated.
Same for the Password field in DatePass.
So the queries function as both an Append and Update query. Is this
normal?
Also I couldn't get them to run properly until I set up a LeftJoin
between them.
I don't understand why it had to be set as a Many -to-One between
the Students table and the DatePass table, when there will never be a
many to one relationship.
Any help would be appreciated. Ric