V
vircalendar via AccessMonster.com
This may be basic, but I've searched AccessMonster for answers and I can't
find the right one.
I have a patient scheduling database that stores patient identification in
one table and information about their procedures in another table. The two
are linked by a field called MRN (medical record number) with a one to many
relationship.
What want to do is pass the MRN to a new form (called requisition) that will
be used for scheduling a new procedure. The form would autopopulate patient
ID info (name, address, allergies, etc) and then have a bunch of blank fields
for the procedure being requested. This seemed to me like a perfect
situation for a subform (the patient data being on the main form and the
procedure data being on the subform), and it worked well that way.
Unfortunately, I ran into the problem of being unable to use the me.undo
feature to reverse changes in both main and subforms (this is covered in
great detail in other posts). Why would I need to do this? Well, the operator
may need to modify medication or allergy data stored on the main form at the
time of scheduling a procedure. I can't have the changes to either the main
or subform updated until the whole thing is finished.
So then I thought I would try making a single form using a query of both
tables as the source. The problem here is that I would have about 30 fields
that need to be populated from the patient data side. I found some ideas
about how to do this, but none that my little mind could apply. One of
these was presented, without any explanation, as:
With Me.RecordsetClone
.FidFirst "nameID=""" & Me.NameID & """"
If .NoMatch Then
' avoid exiting the scope while a With is in effect
Else
Me.Address = .Fields(Address)
Me.City = .Fields(City)
End If
End With
I don't know where to put this or how to use it. Would it be OnOpen of the
new form? If so, would the MRN be passed as an opening argument? How would
this work if the patient has never been seen before and his/her MRN is not on
file? Is there another technique that fit my situation better?
Thanks!
find the right one.
I have a patient scheduling database that stores patient identification in
one table and information about their procedures in another table. The two
are linked by a field called MRN (medical record number) with a one to many
relationship.
What want to do is pass the MRN to a new form (called requisition) that will
be used for scheduling a new procedure. The form would autopopulate patient
ID info (name, address, allergies, etc) and then have a bunch of blank fields
for the procedure being requested. This seemed to me like a perfect
situation for a subform (the patient data being on the main form and the
procedure data being on the subform), and it worked well that way.
Unfortunately, I ran into the problem of being unable to use the me.undo
feature to reverse changes in both main and subforms (this is covered in
great detail in other posts). Why would I need to do this? Well, the operator
may need to modify medication or allergy data stored on the main form at the
time of scheduling a procedure. I can't have the changes to either the main
or subform updated until the whole thing is finished.
So then I thought I would try making a single form using a query of both
tables as the source. The problem here is that I would have about 30 fields
that need to be populated from the patient data side. I found some ideas
about how to do this, but none that my little mind could apply. One of
these was presented, without any explanation, as:
With Me.RecordsetClone
.FidFirst "nameID=""" & Me.NameID & """"
If .NoMatch Then
' avoid exiting the scope while a With is in effect
Else
Me.Address = .Fields(Address)
Me.City = .Fields(City)
End If
End With
I don't know where to put this or how to use it. Would it be OnOpen of the
new form? If so, would the MRN be passed as an opening argument? How would
this work if the patient has never been seen before and his/her MRN is not on
file? Is there another technique that fit my situation better?
Thanks!