Help: Interrupt processing & Return - Logic Issue

P

Pete Beatty

am trying to produce a system that loops though a file and when an error
is found, it opens another form, displays the errors, allows the operator to
make changes, and then return to continue processing the remaining records.

The basic logic I am using follows.

Form1:
opens the records
while NOT eof
read the record
if errors found
open form 2
endif
wend

Form 2
display the error record
get input from user
close form

The problem exists in Form 1. It continues to read records even though Form
2 is active. I know this is common and need to change the logic. However,
I can determine how to intercept the closing of Form 2 and the signallin
back to Form 1. If I can find the proper event, I can correct the error.
Any thoughts or suggestions would be greatly appreciated.

Thanks
 
B

Brian

Pete Beatty said:
am trying to produce a system that loops though a file and when an error
is found, it opens another form, displays the errors, allows the operator to
make changes, and then return to continue processing the remaining records.

The basic logic I am using follows.

Form1:
opens the records
while NOT eof
read the record
if errors found
open form 2
endif
wend

Form 2
display the error record
get input from user
close form

The problem exists in Form 1. It continues to read records even though Form
2 is active. I know this is common and need to change the logic. However,
I can determine how to intercept the closing of Form 2 and the signallin
back to Form 1. If I can find the proper event, I can correct the error.
Any thoughts or suggestions would be greatly appreciated.

Thanks

You don't need to change the logic, you simply need to open form 2 with
WindowMode := acDialog.

Incidentally, While...Wend is archaic and rarely used. The preferred way to
loop through a recordset is to use Do...Loop e.g.:

Do Until rst.EOF
 
P

Pete Beatty

Brian said:
You don't need to change the logic, you simply need to open form 2 with
WindowMode := acDialog.

Incidentally, While...Wend is archaic and rarely used. The preferred way
to
loop through a recordset is to use Do...Loop e.g.:

Do Until rst.EOF
.
.
.
rst.MoveNext
Loop
Thanks. It has been awhile since it programmed at this level. Thanks for
the update on the while/wend
 

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