How to design for an optional form?

  • Thread starter Thread starter Jon A
  • Start date Start date
J

Jon A

I am designing an application that collects, tracks, and
reports Inspection information.

When an Inspector completes an inspection, they close out
the inspection by clicking on one of two buttons, depending
on the result of the inspection.

The two buttons are:
PASS
FAIL

If the inspection passed, then click on PASS and the
inspection is closed out.

If the inspection failed, however, then the Inspector clicks
on FAIL. In that case, before the inspection can be closed
out the application will require that the Inspector indicate
the reasons for the failed inspection.

There are a set of Quality Factors defined that will be
displayed (probably as checkboxes) and the Inspector will
select the one(s) that apply to this specific inspection and
that will record the reason(s) for failure.

As a complication, the collection of the Quality Factors is
required only for some kinds of inspections and not for
others.

I can't figure out how to design the control flow.

I thought the right place to put the code would be on the
cmd_FAIL_Click event. The logic would be something like
this:

If QualityFactorsRequired then
CollectQualityFactors
end if

SetInspectionStatus
SaveInspection
SetFormControlDisplay

My main quandry is that if I go to another form to collect
the Quality Fators, then how do I get back to the main form
to complete the remaining necessary actions for setting the
status, saving, etc?
 
Jon,

If you open another form for the entry of the Quality Factors, the
original form can still be open as well, so when you close the Quality
Factors form, the main form is still there for you to finish off. Or
have I missed something in your meaning?
 
Thanks for the reply.

I was planning on doing that - open the new form and then
just hide the previous one while making the newly-opened
form a modal form. One thing I have to control is that the
Inspectors cannot be allowed to close the form or save the
record without entering the Quality Factors. If they do then
it will screw up the metrics we are trying to capture.

What I can't figure out is the design for capturing the
process flow and continuing where we let off - saving the
record.

When the Inspector clicks on the FAIL button, that action
can open up a Quality Factors form. But then, after they get
done selecting the Quality Factors, how do I go back to
where I left off in the processing and continue to save the
record?

In other words, when they get done entering the Quality
Factors they will need to click on a DONE button or
something like that. After that the record and all the data
needs to be saved.

I can't figure out how to get back to where I was on the
previous form - in the cmd_FAIL_Click button procedure. It
seems that when the Quality Factors form closes I still need
to save the record but how?

I'm an old line procedural language programmer, so this
event-oriented stuff is not always that easy for me to
figure out.
 
Jon,

Jon said:
.... It
seems that when the Quality Factors form closes I still need
to save the record but how?

In Access, it is generally not necessary to explicitly save the record.
The edits are automatically saved when you close the form, or move to
another record. It is not clear what is the relationship, in terms of
table structure, between the data in the main form and the Quality
Factors data, but in any case it is probably simpler than you imagine :-)
 
Back
Top