Page 2 of 2 FirstFirst 12
Results 16 to 19 of 19
  1. #16
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664

    That is the idea. For example, the table tblDUR. You would remove all fields that are drug names and have one field (a FK field) to another table that you store the drugs used/selected (Maybe tblDUR_Details / tblUDS_Details) with a third table that has the list of drug names (tblDrugs). This is a many-2-many relationship.

    "tblDrugs" could have a PK field (autonumber), DrugAbbrev (Text), DrugName (Text), bDUR (Yes/No) and bUDS (Yes/No).

    The fields bDUR and bUDS ("b" is for boolean) are so that you can choose which drugs would be available for selection (using a combo box) in each of the sub forms (DUR and UDS) when adding records.

  2. #17
    jrichardson10 is offline Novice
    Windows 10 Access 2016
    Join Date
    Nov 2017
    Posts
    16
    Steve, I think I understand the concepts you've highlighted. I built the barebones of the tables you suggested (so much smarter than the way I'd instinctively build it). However, I'm looking at part of what you said:

    Quote Originally Posted by ssanfu View Post
    one field (a FK field) to another table that you store the drugs used/selected (Maybe tblDUR_Details / tblUDS_Details) with a third table that has the list of drug names (tblDrugs). This is a many-2-many relationship.
    My question thus becomes, in the tblDUR_Details, I have my PK field (auotnumber), but then the next field is... what? My first thought was a short text field that would effectively be a list that I don't have to sit there and type. But does it actually need to be a different field type? I have not created tblUDS_Details because once I get this one sorted, I want to build it on my own and see how well I do. It's basically the same thing just from a different physical data source so I think I can manage.

    Quote Originally Posted by ssanfu View Post
    The fields bDUR and bUDS ("b" is for boolean) are so that you can choose which drugs would be available for selection (using a combo box) in each of the sub forms (DUR and UDS) when adding records.
    Another rookie question, how do I tell it that I want to be able to select more than one option in a combo box? The combo box will drop down and present me with a variety of options, but how do I tell it I want "these four" or whatever subset? Not necessarily while I'm working in the form, but whilst designing the table. I've attached my meager progress.
    Attached Files Attached Files

  3. #18
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,742
    how do I tell it that I want to be able to select more than one option in a combo box
    Use a listbox, not a combo.
    Here's an article I found via Google.
    Good luck.

  4. #19
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    In tblDrugs, I suggested having two Boolean fields to be able to select which drugs are available to DUR and which drugs are available to UDS. If both DUR and UDS will ALWAYS have the identical drugs available, then you could remove the two Boolean fields.


    Quote Originally Posted by jrichardson10 View Post
    My question thus becomes, in the tblDUR_Details, I have my PK field (auotnumber), but then the next field is... what? My first thought was a short text field that would effectively be a list that I don't have to sit there and type. But does it actually need to be a different field type? I have not created tblUDS_Details because once I get this one sorted, I want to build it on my own and see how well I do. It's basically the same thing just from a different physical data source so I think I can manage.
    The order of the fields in a table do not matter. However, I always have the PK field as the first field, followed by any FK fields, then numeric fields, text fields, etc. because it is easier to field a field if it is "grouped" by type.


    Quote Originally Posted by jrichardson10 View Post
    Another rookie question, how do I tell it that I want to be able to select more than one option in a combo box? The combo box will drop down and present me with a variety of options, but how do I tell it I want "these four" or whatever subset? Not necessarily while I'm working in the form, but whilst designing the table. I've attached my meager progress.
    You can't with a combo box. I would use a main form/sub form arraignment, with a combo box to select the drugs wanted. Would only have to type on the date.



    I created the queries and sub forms... you should look at this dB
    Look at the relationship window, the table tblDrugs, tblDUR, tblUDS, the sub forms and the row source for the combo boxes on the two sub forms.

    Then use the Draft4 version and recreate what I did.
    Attached Files Attached Files

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Build a database
    By chaddresnick in forum Access
    Replies: 2
    Last Post: 03-17-2015, 01:31 PM
  2. Replies: 1
    Last Post: 01-13-2014, 11:36 AM
  3. Medical Database Design for Research
    By JJ22 in forum Database Design
    Replies: 20
    Last Post: 08-22-2012, 05:44 PM
  4. Medical billing Database Design
    By Ray67 in forum Database Design
    Replies: 5
    Last Post: 08-22-2012, 11:36 AM
  5. Please Help! Designing a medical database
    By DrJ in forum Database Design
    Replies: 3
    Last Post: 11-10-2011, 01:27 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums