Patientnumber is displayed on form but not stored in table?

  • Thread starter Thread starter Bibi
  • Start date Start date
B

Bibi

Hello all,

I have asked the following question before, but I couldn't
understand the answer (Visual Basic is not my expertise).
So let me try again:

On a start-form I let data entry begin with entering a
patientnumber. This patientnumber is then displayed in the
header of all following forms. However, I want this
patientnumber to be entered 'automatically' in the all
tables belonging to the all forms as well, and not only in
the table of the start form. Can anybody explain how this
is done ? And if in VBA, then please be clear where to put
what ?

Thanks.
 
I don't understand your question. If you have a form based on a table, and
the Patient number is one of the fields in the table (and form) then you
have no problem.

Are you saying that you have multiple (related) tables and you want to use
the patient number as a key for all the tables?

What other tables do you have?

Give us more details.

Rick B
 
Hi Rick,

I am sorry that my question is not clear. Let me give some
additional information. I have indeed multiple tables,
which ALL contain a variable PATIENT_ID. The data to be
entered are medical data, which need to be statistically
analyzed further on.

However, I do not want the data entrists to need to fill
in the patient number in every form (so that it is saved
in every table). It is much simpeler if they have to enter
the patient number only once (on the start form), and then
go through all the forms filling in the data, where in the
header they can see the patient number they filled in on
the start form. But this patient number needs to be stored
in every one of the tables (the tables underlying the
forms) as well (it is indeed a key variable). And I don't
know how this can be done 'automatically'. There might be
a very simple solution to it, but I am not that good with
Access yet...

I hope I have made myself clear, if not, please ask again !

Greeting, Bibi.
 
The way I do that is to pull all the tables to my query and set up my
relationships as one-to-one or one-to-many relationships.

In some cases, (mostly one-to-many) you may have to pull the "patientID"
field from each of your tables onto your data entry form. (sounds like you
already did that). You don't, however, need to get the users to fill it in.
You can build code to have the related patientID fields fill in with the
value from the primary one.

For example...

MainData (PatientID, FirstName, LastName, Phone)
SecureData (PatientNumber, Gender, Birthdate, etc...)
VisitData (VisitNumber, VisitTime, VisitDate, VisitPatientID)
BillingData (BillingID, BillingDate, BillingAmt, etc.)

You would have the MainData and the SecureData tables linked (one-to-one)
with the PaitientID and the PatientNumber fields as the shared key. On your
form, you'd have all the fields from both tables. The PatientNumber field
from the SecureData table could be hidden, You'd build code (maybe on the
afterupdate of the PatientID field to put the value from that field into the
value of the PatientNumber field.



You would build relationships (one-to-many) linking the MainData to the
VisitData. The PatientID and the VisitPatientID would be the related
fields. Similar relationships would exist for the other tables. These
entries would most likely be made in a different form and would require your
user to choose the Patient Number and put it in the appropriate field.

Hope that helps,

Rick B
 
Hi Rick,

Thanks for your answer, but could you tell me how this
code you mention would look like ? Because, like I said,
I'm not really familiar with Visual Basic....

("You'd build code (maybe on the afterupdate of the
PatientID field to put the value from that field into the
value of the PatientNumber field.")

Thanks !
 
Back
Top