Requery a Form

K

Kathy G

I am a novice at coding and would appreciate some help. I have 2 forms. One
form the user enters start and end times for a student who is testing and a
2nd form that is a pop up for display of information only. It displays which
testers are currently testing and how much time they have left in their
testing session based on the information entered in the 1st form. My 2nd
form needs to requery every few seconds to show time remaining in each
testers session as well as new testers as they arrive and delete testers who
have finished. I have set the forms Onload property to Timer(), the
TimerInterval Property to 10000 and the OnTimer Property to the following
Event Procedure

Private Sub Form_Timer()
'Requery the form
Forms!TestInProgressForm.Requery
End Sub

This works fine to continually calculate the the students time remaining in
the testing session but does not add new testers or remove finished testers
unless I close and reopen the form. Please help.
 
K

Kathy G

David By "The Control Source" do you mean the Query that the Form is based on?

Form 2
Form Name: frmTestInProg
Query form is based on: qryTestInProg
Each record on Form bound to Control: txtStudentId
 
D

David Mueller

Yes, sorry, I mispoke.

What is the actual SQL text behind the "qryTestInProg"
 
K

Kathy G

The SQL is quite long:

SELECT tblStudentTests.numStudentTestId,
tblStudentApplications.txtStudentId, tblStudentApplications.txtLastName,
tblStudentApplications.txtFirstName, tblStudentTests.[Seat#],
tblDETestInfo.TestLength, tblStudentTests.StartTime,
tblStudentTests.StopTime, tblTestDates.txtTestId
FROM tblTestDates INNER JOIN (tblStudentApplications INNER JOIN
((tblDECourse RIGHT JOIN (tblDEInstructor RIGHT JOIN tblDETestInfo ON
tblDEInstructor.InstructorID = tblDETestInfo.InstructorName) ON
tblDECourse.CourseID = tblDETestInfo.[Course#]) RIGHT JOIN (tblStudentPayment
RIGHT JOIN tblStudentTests ON tblStudentPayment.numStudentTestId =
tblStudentTests.numStudentTestId) ON tblDETestInfo.DETestID =
tblStudentTests.DETestID) ON tblStudentApplications.txtStudentId =
tblStudentTests.txtStudentId) ON tblTestDates.txtTestDateId =
tblStudentTests.txtTestDateId
WHERE (((tblStudentTests.StartTime) Is Not Null) AND
((tblStudentTests.StopTime) Is Null) AND ((tblTestDates.txtTestId)="P" Or
(tblTestDates.txtTestId)="ADA"))
ORDER BY tblStudentApplications.txtLastName,
tblStudentApplications.txtFirstName;
 
D

David Mueller

That's a good lookin' WHERE clause for a "novice coder"!

Kathy G>>> but does not add new testers or remove finished testers

I thought we'd find the answer in there, but the where clause looks ok.
Umm..... I gotta think about this...



Kathy G said:
The SQL is quite long:

SELECT tblStudentTests.numStudentTestId,
tblStudentApplications.txtStudentId, tblStudentApplications.txtLastName,
tblStudentApplications.txtFirstName, tblStudentTests.[Seat#],
tblDETestInfo.TestLength, tblStudentTests.StartTime,
tblStudentTests.StopTime, tblTestDates.txtTestId
FROM tblTestDates INNER JOIN (tblStudentApplications INNER JOIN
((tblDECourse RIGHT JOIN (tblDEInstructor RIGHT JOIN tblDETestInfo ON
tblDEInstructor.InstructorID = tblDETestInfo.InstructorName) ON
tblDECourse.CourseID = tblDETestInfo.[Course#]) RIGHT JOIN (tblStudentPayment
RIGHT JOIN tblStudentTests ON tblStudentPayment.numStudentTestId =
tblStudentTests.numStudentTestId) ON tblDETestInfo.DETestID =
tblStudentTests.DETestID) ON tblStudentApplications.txtStudentId =
tblStudentTests.txtStudentId) ON tblTestDates.txtTestDateId =
tblStudentTests.txtTestDateId
WHERE (((tblStudentTests.StartTime) Is Not Null) AND
((tblStudentTests.StopTime) Is Null) AND ((tblTestDates.txtTestId)="P" Or
(tblTestDates.txtTestId)="ADA"))
ORDER BY tblStudentApplications.txtLastName,
tblStudentApplications.txtFirstName;


David Mueller said:
Yes, sorry, I mispoke.

What is the actual SQL text behind the "qryTestInProg"
 
K

Kathy G

Thanks any thing you can come up with would be appreciated.

David Mueller said:
That's a good lookin' WHERE clause for a "novice coder"!

Kathy G>>> but does not add new testers or remove finished testers

I thought we'd find the answer in there, but the where clause looks ok.
Umm..... I gotta think about this...



Kathy G said:
The SQL is quite long:

SELECT tblStudentTests.numStudentTestId,
tblStudentApplications.txtStudentId, tblStudentApplications.txtLastName,
tblStudentApplications.txtFirstName, tblStudentTests.[Seat#],
tblDETestInfo.TestLength, tblStudentTests.StartTime,
tblStudentTests.StopTime, tblTestDates.txtTestId
FROM tblTestDates INNER JOIN (tblStudentApplications INNER JOIN
((tblDECourse RIGHT JOIN (tblDEInstructor RIGHT JOIN tblDETestInfo ON
tblDEInstructor.InstructorID = tblDETestInfo.InstructorName) ON
tblDECourse.CourseID = tblDETestInfo.[Course#]) RIGHT JOIN (tblStudentPayment
RIGHT JOIN tblStudentTests ON tblStudentPayment.numStudentTestId =
tblStudentTests.numStudentTestId) ON tblDETestInfo.DETestID =
tblStudentTests.DETestID) ON tblStudentApplications.txtStudentId =
tblStudentTests.txtStudentId) ON tblTestDates.txtTestDateId =
tblStudentTests.txtTestDateId
WHERE (((tblStudentTests.StartTime) Is Not Null) AND
((tblStudentTests.StopTime) Is Null) AND ((tblTestDates.txtTestId)="P" Or
(tblTestDates.txtTestId)="ADA"))
ORDER BY tblStudentApplications.txtLastName,
tblStudentApplications.txtFirstName;


David Mueller said:
Yes, sorry, I mispoke.

What is the actual SQL text behind the "qryTestInProg"



:

David By "The Control Source" do you mean the Query that the Form is based on?

Form 2
Form Name: frmTestInProg
Query form is based on: qryTestInProg
Each record on Form bound to Control: txtStudentId

:

Can you post the control source of the form?

:

I am a novice at coding and would appreciate some help. I have 2 forms. One
form the user enters start and end times for a student who is testing and a
2nd form that is a pop up for display of information only. It displays which
testers are currently testing and how much time they have left in their
testing session based on the information entered in the 1st form. My 2nd
form needs to requery every few seconds to show time remaining in each
testers session as well as new testers as they arrive and delete testers who
have finished. I have set the forms Onload property to Timer(), the
TimerInterval Property to 10000 and the OnTimer Property to the following
Event Procedure

Private Sub Form_Timer()
'Requery the form
Forms!TestInProgressForm.Requery
End Sub

This works fine to continually calculate the the students time remaining in
the testing session but does not add new testers or remove finished testers
unless I close and reopen the form. Please help.
 
S

Suresh

dear sir,
I want to design the database or forms for our factory workers with start
time and end time. when worker entered the end time that time pop up should
be come with total time he has worked.
Suresh Shinde
 

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

Top