Jonathan,

What you are wanting are related tables.

You need another table lets call PatientMeds. In it you need an integer
rowid key field, an integer field called PatientRowid and an integer
field called MedicationsRowid. When you select a medication to display
in the patient's medications ListBox you will add a record to
PatientMeds that stores the rowid of the patient and the rowid of the
med. When you display the patient's meds in the ListBox you will use a
query something like the following:

SELECT MedName, MedDescrption, MedDosage, FROM Medications WHERE
Medicatons.rowid = PatientMeds.MedicationsRowid and
PatientMeds.PatientRowid = Patients.rowid

You will need to use your actual column names and refine the query but
this is how you go about creating relational databases. There is more to
it than this example and I would recommend getting a book on relational
database design so you have a better understanding. 

HTH

Tom

> Ok, I am working on a project that has a main 'patient' 
> database.  It will hold all the important info of the 
> patient.  But I want to create a listbox that will hold all 
> the paitent's medications in it?
> 
> I have the main DB created using the example RB2005 DB, but I 
> am now lost as to how to create the listbox DB.  I have 2 
> tables, Pateints and one Medications.  Ok, the main BD works 
> fine as it adds saves and delete the pateints fine.
> 
> But I am lost as how to figure out the example of the RB2005 
> DB to include the Medications table to the already Patients 
> table, or more to the point as how to connect the two tables 
> to work as one.
> 
> Example:
> 
> Patient: Jon Smith created a new patient in the program.  I 
> have used Revision No's so the patient may update their files 
> with OUT deleting the old data.  This is kinda like the 
> Customers, Orders and Products RB2005 DB Example.
> 
> Jon Smith, Rev. No. 1, has 3 meds to add to the listbox.  The 
> adding the meds to the already patient table db from a 
> listbox has me stumped.
> 
> Any help or better yet any examples as how i can do this?
> 
> Thanks
> 
> Jonathon 
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to