Question Again

D

DUNNER7

I am still working on my attendance database for my students. I was able to
take demographics: studentid, lastname firstname into a table to feed
attendance form. I created a form using multiple items and it lists all the
student's first and last names. I was trying to write the code that would
allow me to double click the last name on the form and cause the time entered
to be registered on my table that records entry time with the student id.
Thanks in advance for all your continued help.

Del Dobbs
 
M

Mike Painter

DUNNER7 said:
I am still working on my attendance database for my students. I was
able to take demographics: studentid, lastname firstname into a
table to feed attendance form. I created a form using multiple items
and it lists all the student's first and last names. I was trying to
write the code that would allow me to double click the last name on
the form and cause the time entered to be registered on my table that
records entry time with the student id. Thanks in advance for all
your continued help.

Del Dobbs
Probably the easiest way would be to build an append query with the query
builder
Criteria for the date would be Now() which will contain date and time.
Criteria for the student ID would be Forms!YourFormName!YourStudentID.

See help for DoCmd.runquery.
You will get a couple messages telling you what is going on.
When you are happy with the results you can turn those messages off if you
want. doCmd.setwarnings False and after the update DoCmd.setwarnings True.

After it works look at the SQL view of the query to see what it looks like.
I suspect that you will want to modify it at some point.
 
N

NevilleT

Hi Del
If I understand correctly, you want to double click the surname and trigger
the current time. Not clear what you want to do with it then. Do you want
to directly update a table? Do you want to display it on the form? Do you
want to display it in a subform?
 
J

John W. Vinson

I am still working on my attendance database for my students. I was able to
take demographics: studentid, lastname firstname into a table to feed
attendance form. I created a form using multiple items and it lists all the
student's first and last names. I was trying to write the code that would
allow me to double click the last name on the form and cause the time entered
to be registered on my table that records entry time with the student id.
Thanks in advance for all your continued help.

Del Dobbs

Sorry... I was responding last week and dropped the thread.

What I'd suggest is using two tables: Students (primary key StudentID,
lastname, firstname, etc.) and Attendence (AttendanceID autonumber primary
key, StudentID, EntryDateTime, any other needed fields about that student on
that day, e.g. reason for nonattendance or comments).

You could have a coutinuous Form based on Students and a *second* continuous
form, frmAttendance, based on a query of the Attendance table, using a
criterion
= Date() AND < Date() + 1

on the EntryDateTime field.

In the dblclick event of the name field (or a command button on the continuous
form) run an append query:

INSERT INTO ATTENDANCE (StudentID, EntryDateTime)
VALUES (Forms!frmStudents!StudentID, Now());

and requery the attendance form after running the query.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top