I
Impecunious
I've got a tab control that drives several things, and I'm running into
a problem.
The user searches for a particular patient using unbound controls on a
Patient search tab, and a subform displays the associated results.
When the user selects the patient they want in the subform's datasheet,
this selection drives the results shown in the other two main tabs of
the form, like Patient Details and Transactions. The problem is,
whenever the user
deletes a particular transaction in the Transactions subform, I lose
the primary key
of the patient they previously selected from the Patient Search
subform. Instead, the user
sees the transactions of the very first patient in the underlying
table.
For my transactions sub form, for example, I make this association as
such:
Me.subfrm_transaction_transactions.Form.Filter = "PATIENT_ID = " &
Me.FRM_SUB_PATIENT.Form!PATIENT_ID
I've created a variable to capture this patient ID, and this remedies
part of the problem, but I'm really hoping there's a more elegant way
to preserve the selected patient in the subform, regardless of any
actions the user makes elsewhere in the main tabs. This issue doesn't
happen for edits or adds I make to records in my Transactions tab -
only for deletes.
Thanks!
a problem.
The user searches for a particular patient using unbound controls on a
Patient search tab, and a subform displays the associated results.
When the user selects the patient they want in the subform's datasheet,
this selection drives the results shown in the other two main tabs of
the form, like Patient Details and Transactions. The problem is,
whenever the user
deletes a particular transaction in the Transactions subform, I lose
the primary key
of the patient they previously selected from the Patient Search
subform. Instead, the user
sees the transactions of the very first patient in the underlying
table.
For my transactions sub form, for example, I make this association as
such:
Me.subfrm_transaction_transactions.Form.Filter = "PATIENT_ID = " &
Me.FRM_SUB_PATIENT.Form!PATIENT_ID
I've created a variable to capture this patient ID, and this remedies
part of the problem, but I'm really hoping there's a more elegant way
to preserve the selected patient in the subform, regardless of any
actions the user makes elsewhere in the main tabs. This issue doesn't
happen for edits or adds I make to records in my Transactions tab -
only for deletes.
Thanks!