Field in one form inheriting from another form when closing the latter??

N

Nils Tommy

Hi,
I have been looking for an answer the whole week to this problem:
I have a table Patients with a Combibox patientID and another Combibox
PatientName.
Another table Treatment with a listbox patientID, many-to-one related to the
first patientID (plus a lot of other fields...)
For a new patient I need to use a form NewPatient updating the table
Patients, no problems... Going from this form to my Treatment form I want
the new patient data to be included in the Treatment form, that is: I want
the Treatment form to show the new patient data ONLY if I use the
NewPatient form, OTHERWISE I want lists view of old patient names and
patient ID in the Treatment form.
AND how do I connect the PatientID field and the PatientName fields in my
Treatment form so when selecting EITHER PatientName OR PatientID the other
field automatiaclly updates w the corresponding name/ID from the Patients
table? It is SO D*d frustrating... I have been programming 20 years, but not
database stuff. I am in deep water, no swimming available. Please have mercy
with me...! Give me a hint!
 
J

John Vinson

AND how do I connect the PatientID field and the PatientName fields in my
Treatment form so when selecting EITHER PatientName OR PatientID the other
field automatiaclly updates w the corresponding name/ID from the Patients
table?

By not putting the PatientName field in this table AT ALL!

In a relational database, you try to avoid redundancy. If you store a
patient's name, you store it ONLY ONCE - in the Patient bio table; if
you need to see the name in conjunction with treatment data, you store
the PatientID (only!) in the Treatment table, and use a Query or a
combo box displaying the name while storing the ID.
 

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