Hi,
What would you suggest for pausing a loop that's in process?
I've got a loop constructed that imports records into a table. When it's a new record I want it to pause to let me create a new entry into a separate table thereby ascertaining a new ID, which upon resuming the loop, will be used to import the new record.
Here's my pseudo code...
What I'll want to do is stop the loop, open up a form, enter information, and click save. That then will create the ID needed. Then come back, update that import record with the ID and have the loop resume.
What I've done already, as an alternative, is set it aside by importing it to another table which I then process manually. I'm looking for a solution that will expedite this process by having it semi-automated, after all it's only missing the ID. As well, most records should import automatically, thus only the new ones require this attention.
I'm not sure if DoEvents() is the solution here. If so, I don't know how the syntax would work.
I was thinking of the Assert method? That plausible?
I'd like to know what is available to make this work. Any help would be appreciated.
Regards.
What would you suggest for pausing a loop that's in process?
I've got a loop constructed that imports records into a table. When it's a new record I want it to pause to let me create a new entry into a separate table thereby ascertaining a new ID, which upon resuming the loop, will be used to import the new record.
Here's my pseudo code...
Code:
Public Sub ImportExample()
For x = 1 To files
If IsNull(files.ID) Then
' Here's where I need something something
' to stop this loop from continuing while
' I do something else to make available an
' ID for the loop to carry on.
End If
' a call to routine that processes import.
importRecord (x)
Next
End Sub
What I'll want to do is stop the loop, open up a form, enter information, and click save. That then will create the ID needed. Then come back, update that import record with the ID and have the loop resume.
What I've done already, as an alternative, is set it aside by importing it to another table which I then process manually. I'm looking for a solution that will expedite this process by having it semi-automated, after all it's only missing the ID. As well, most records should import automatically, thus only the new ones require this attention.
I'm not sure if DoEvents() is the solution here. If so, I don't know how the syntax would work.
I was thinking of the Assert method? That plausible?
I'd like to know what is available to make this work. Any help would be appreciated.
Regards.