N
Nick via AccessMonster.com
Hello,
My VBA database application that I have written is starting to have some
problems with performance; as the number of records have grown, the
processing time has greatly increased. I am trying to find if there is any
way to cut down processing time short of a major overhaul of my code (which
it badly needs - the development was more of a series of random leaps than an
organized on-paper process).
The app manages the creation of parts and controls the sequence of inputs;
there are 3 tables involved where the slow performance occurs.
-table A contains all the part information (1 unique ID per record)
-table B contains information about steps in the part creation process (what
steps must be complete for data entry into the next step, what steps will be
"frozen" if data is entered in a later step),
-table C contains one record per (ID in table A) and (step in table B), and
tracks the completion/frozen states of each kit on each step
The pseudocode for the slow process is as follows:
Set rsA = db.openrecordset(SELECT Unicode FROM table A) 'Just loads up the
unique ID
Set rsB = db.openrecordset(table B)
rsA.Movefirst
Do Until rsA.EOF
Set rsC = db.openrecordset(IDs from table C that are equal to the current
ID on table A)
rsB.Movefirst
Do Until rsB.EOF
'Finds the first step that must be complete from rsB
'Uses FindFirst to find that step in rsC
'If Step = Complete, jump to current step in rsC, (various commands)
'Moves to the next record of rsB
Loop
'Moves to the next record of rsA
Loop
The nested Do loops take awhile to complete, but I really can't think of
another way to go about this. I am fairly sure that the problem just comes
from jumping through recordsets so much. All of the recordsets I am using
are SQL based to select only the vital information, but they still take
awhile to complete. Predefined queries are out of the question, because the
user must be able to change table B at any time and not have to change any
other tables/configurations (the application conforms to the changes).
Any help would be great appreciated. Thanks for reading this, and thanks in
advance for any advice.
-Nick
My VBA database application that I have written is starting to have some
problems with performance; as the number of records have grown, the
processing time has greatly increased. I am trying to find if there is any
way to cut down processing time short of a major overhaul of my code (which
it badly needs - the development was more of a series of random leaps than an
organized on-paper process).
The app manages the creation of parts and controls the sequence of inputs;
there are 3 tables involved where the slow performance occurs.
-table A contains all the part information (1 unique ID per record)
-table B contains information about steps in the part creation process (what
steps must be complete for data entry into the next step, what steps will be
"frozen" if data is entered in a later step),
-table C contains one record per (ID in table A) and (step in table B), and
tracks the completion/frozen states of each kit on each step
The pseudocode for the slow process is as follows:
Set rsA = db.openrecordset(SELECT Unicode FROM table A) 'Just loads up the
unique ID
Set rsB = db.openrecordset(table B)
rsA.Movefirst
Do Until rsA.EOF
Set rsC = db.openrecordset(IDs from table C that are equal to the current
ID on table A)
rsB.Movefirst
Do Until rsB.EOF
'Finds the first step that must be complete from rsB
'Uses FindFirst to find that step in rsC
'If Step = Complete, jump to current step in rsC, (various commands)
'Moves to the next record of rsB
Loop
'Moves to the next record of rsA
Loop
The nested Do loops take awhile to complete, but I really can't think of
another way to go about this. I am fairly sure that the problem just comes
from jumping through recordsets so much. All of the recordsets I am using
are SQL based to select only the vital information, but they still take
awhile to complete. Predefined queries are out of the question, because the
user must be able to change table B at any time and not have to change any
other tables/configurations (the application conforms to the changes).
Any help would be great appreciated. Thanks for reading this, and thanks in
advance for any advice.
-Nick