How to add a record ID to a access table
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums
Results 1 to 2 of 2

Thread: How to add a record ID to a access table

Hybrid View

  1. #1
    Join Date
    Feb 2009

    How to add a record ID to a access table

    I have a table in access that has only two fields: one is the PATIENT_ID and the second is DRUG_NAME. There are multiple records with different DRUG NAMES for each patient ID. I am trying to figure out a way to add a third field that would say DRUG_1, DRUG_2, etc for each patient ID. So, the DRUG_1 would start new when it's a new PATIENT_ID

    Any thoughts?

  2. #2
    Join Date
    Aug 2003
    Sydney, Australia

    Re: How to add a record ID to a access table

    I think you have 2 tables from what you are saying

    Table 1 - Patient_File

    Patient_ID <<<<UNIQUE KEY
    etc etc etc etc

    Table 2 - Patient_Drugs_File

    Patient_ID <<<<<NON-UNIQUE KEY - Same as Patient_ID in Table 1

    Table 2 can hold any number of records belonging to the Patient_ID in Table 1

    Table 2 could also hold more information about the drug if required

    Table 2 - Patient_Drugs_File

    Patient_ID <<<<<NON-UNIQUE KEY


    For example Drug_Group could even identify a problem when a Doctor prescribes a Drug to a Patient who has an Allergy to a certain group of drugs (held in the "Patient_Drug_Allergies" Table

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Azure Activities Information Page

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


HTML5 Development Center