Populating a record on different forms

R

Ramtin

I have created 7 tables and I defined a primary key which is similar in all
tables, my primary key is Medical record number of patients which is specific
for each person and I can make queries based on this number( If I made a
mistake please give me the hint) when database is complete. so I made forms
according to these tables, now what I am trying to do is just asking the
users to enter this number once so it is automatically appears on following
forms until all data entered.

I have one more question: How I can make a command button perform 3
different task with a click( save and close the current form and open the
following form). it seems every button just do one command.
 
K

KARL DEWEY

You did not say what the 7 tables are for but I assume they are related to
the patient. If so, then do not used the Medical record number of patients
as a primary key for the other tables but as a foreign key. Set a
one-to-many relation from the main table primary key to the foreign key of
the related table. Select referential integerity and cascade update but DO
NOT select cascade delete unless you know what you are doing.

Use your tables/forms in a main-form/subform manner. You will not have to
ask the users to enter patient number on the subforms. Set the Master/Child
link between the main/subform.
 
K

KARL DEWEY

Your 2nd question --
Have the button call a macro that can execute any number of commands.
 
J

John Vinson

I have created 7 tables and I defined a primary key which is similar in all
tables, my primary key is Medical record number of patients which is specific
for each person and I can make queries based on this number( If I made a
mistake please give me the hint) when database is complete. so I made forms
according to these tables, now what I am trying to do is just asking the
users to enter this number once so it is automatically appears on following
forms until all data entered.

I have one more question: How I can make a command button perform 3
different task with a click( save and close the current form and open the
following form). it seems every button just do one command.

How do these seven tables differ? It would be EXTREMELY unusual to
have seven tables all with the same Primary Key. This would mean that
each patient would have one, and only one, record in each table.
Surely in a medical records application each patient might have
multiple Diagnoses, Visits, attending physicians, and so on? If so,
then you should have the PatientID as a *foreign* key - a linking
field, not the primary key - in multiple tables; but you would not
need or want to create "placeholder" records with just the patientID
in these tables.


John W. Vinson[MVP]
 
R

Ramtin

I do not want to have form and subform to be displayed at the same time,
that's why I am trying to link my table/form to each other, as you told I
linked medical record field on main table to all other tables with same field
but still now I can not populate the value of medical record number on all of
my tables/forms
Please help, I am sick of it
 
J

John Vinson

I do not want to have form and subform to be displayed at the same time,
that's why I am trying to link my table/form to each other, as you told I
linked medical record field on main table to all other tables with same field
but still now I can not populate the value of medical record number on all of
my tables/forms
Please help, I am sick of it


Could you describe what these tables represent? How are you trying to
"link" them, if not using Subforms? Do you want to prepopulate all
seven related tables with just a PatientID? If so, be aware that this
is almost certainly a VERY BAD IDEA and suggests that your table
design needs work. How do you anticipate that filling the table with
empty "placeholder" records - which might or might not get filled in
with other data, someday - will benefit you?

One suggestion, if it's just a matter of displaying data: you could
have a Form with an eight-page Tab Control on it. The first page of
the tab control could have the main table patient-specific data
controls; each other page would have a Subform bound to one of the
other tables. That way the user would see only one table's information
at a time, and you would not need any code.

If you really, really want to pop up seven different forms and have
each one default to entering the Medical Record number by default, you
can; post back explaining *why* you think this is necessary
(describing the nature of the tables) and I'll explain. I still don't
think it's a good design though, hence I'm waiting to post it.

John W. Vinson[MVP]
 
Top