Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recordset - MoveLast, EOF

Status
Not open for further replies.

jfrizelle

Programmer
Jan 15, 2004
26
0
0
IE
I have a form that I use to create training records for employees to go on courses.

When attempting to put an employee on a course, I want to check that they have completed the pre-requisite courses (or are at least scheduled to do them).

I have two recordsets - one to select the pre-requisites for the course (rs), and one to select any training records for each of those pre-requisites (rs_Pre_Req).

Once I find any pre-requisite course that they have not done and are not scheduled to do, I have a line of code to close the pre-requisite recordset (rs_Pre_Req.Close), and move to the last record of the other recordset (rs.MoveLast).

Outside my FOR loop, I have code to close the rs if it at EOF - but having put a breakpoint on that line, it apparently is not at EOF, even though I have moved to the last record!

Can anyone help with this?

Thanks
Jennie.
 
Me again - sorry, silly mistake on my part.

rs.movelast only moves the pointer to the beginning of the last record, not to the end of the file.

I've changed to code to rs.move(rs.recordcount + 1) and it's now at eof.

Jennie.
 
Could you provide some of your code.

Have you considered using:

While Not rst.EOF

Wend

instead of the For/Next
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top