How Can You Make Sure Users Save Subform Records Correctly?

N

Nick

Hi Programmers,
Users are sometimes clicking a save button in a subform more than
once, attaching the same record(s) from a subform combobox > 1 time in
the underlying join table.

On the flip side, users are sometimes forgetting to click the save
button to save the record(s) in the subform and are, instead, clicking
some other button on the main form. Therefore, the subform record(s)
never get joined.

So, my question is how to help automate the subform save process.
This whole dbase is about recording student misbehavior incidents or
interventions, where 1 intervention has 1 student, 1 or > 1 staff
involved, and 1 or > 1 misbehaviors involved.

How can access detect the following?

Thanks for any and all help.

===============================================

Here is background info on the main and subforms:

SUBFORM #1 = sfrmStaffAndInts

SELECT jtblStaffAndInts.StaffAndIntsID,
jtblStaffAndInts.InterventionID, jtblStaffAndInts.StaffID,
jtblStaffAndInts.RoleID, Staff.StaffLastName, Staff.StaffFirstName,
Staff.StaffExtension, IIf(IsNull([StaffFirstName]),[StaffLastName],
[StaffLastName] & ", " & Left([StaffFirstName],1) & ".") AS txtStaff,
Concatenate("Select qryStaffAndInts_2.txtStaff from qryStaffAndInts_2
where InterventionID = " & jtblStaffAndInts.InterventionID) AS
txtStaffs
FROM Staff INNER JOIN jtblStaffAndInts ON Staff.StaffID =
jtblStaffAndInts.StaffID;


SUBFORM #2 = sfrmMisbehaviorsAndInts

SELECT jtblMisbehaviorsAndInts.MisbehaviorID,
jtblMisbehaviorsAndInts.InterventionID,
jtblMisbehaviorsAndInts.MisbehaviorsAndIntsID,
Misbehaviors.Misbehavior, Misbehaviors.Misbehavior AS txtMisbehavior,
Concatenate("Select qryMisbehaviorsAndInts_2.txtMisbehavior from
qryMisbehaviorsAndInts_2 where InterventionID =" &
jtblMisbehaviorsAndInts.InterventionID) AS txtMisbehaviors
FROM Misbehaviors INNER JOIN jtblMisbehaviorsAndInts ON
Misbehaviors.MisbehaviorID = jtblMisbehaviorsAndInts.MisbehaviorID;

MAINFORM = frmInterventions

SELECT Clients.ClientID, Clients.ClientLname, Clients.ClientFname,
Clients.ClientOname, Clients.DormID, Dorms.DormName, Dorms.DormPhone,
Clients.Active_Inactive
FROM Dorms INNER JOIN Clients ON Dorms.DormID = Clients.DormID
WHERE (((Clients.Active_Inactive)=0))
ORDER BY Clients.ClientLname, Clients.ClientFname;
 
K

Keith Wilby

Nick said:
Users are sometimes clicking a save button in a subform more than
once, attaching the same record(s) from a subform combobox > 1 time in
the underlying join table.

Why do you need a save button? If your form/sub-form are correctly linked
then the problem you're experiencing won't occur and records will be saved
as the user navigates between records.

Keith.
www.keithwilby.co.uk
 
N

Nick

Okay, here is the larger picture:

I was hoping that this would be able to be understood just on the info
provided.
There are actually 6 subforms on this mainform, only 4 of which
pertain in this case. It was a trick to get around Access's
limitations of 3 nested forms.

Here is the functionality:

When a user selects a client on the mainform, named frmInterventions,
the focus goes to a subform named subIntRecent. ClientID is the parent/
child link. On clicking a save button here, a new record is added to
another subform, sfrmIntsPast, which was placed adjacent to
subIntRecent (for sorting purposes), and the focus goes to another
subform...

sfrmStaffAndInts, where the link child field is InterventionID and the
link master field is [sfrmIntsPast].Form![InterventionID]. Here, the
user can select 1 or more staff involved. When pressing the save
button in this subform, the focus goes to another subform...

sfrmMisbehaviorsAndInts, where the link child field is InterventionID
and the link master field is [sfrmIntsPast].Form![InterventionID].
Here, the user can select 1 or more misbehaviors associated with the
incident.
 
N

Nick

It's been about a year since I've messed with this dbase; am having
trouble describe my basic question.

These subforms are continuous forms and cycle only within the
subforms--this is good because the users can immediately see what
they've already entered. They can keep addding staff and keep adding
misbehaviors in the subforms. Therefore, they must click a cmdSave
when they're done entering data in the subforms (clicking cmdSave then
changes the focus).

Well, the users are sometimes forgetting to click cmdSave in the last
form. I know that records are typically auto saved when going to a
next record, but, in this case, I want the form to detect if a new
subform record has been created, and if so, NOT allow the focus
anywhere else on the main form until the user clicks the cmdSave on
this subform.

Is this more clear?
 

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