Results 1 to 13 of 13
  1. #1
    Aimee is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    19

    Question Relationships: I know what I want, but dont know how to do it!


    I have a database with a table that records patient details, including each persons 'Practice Name' and the ' Practice Code'.

    Each practice name has a unique practice code. Rather than filling out both of these fields for each patient I want to be able to write the Practice Name, and for Access to know which code this corresponds to (preferably for this to be displayed automatically).


    So far I have for so far as to create a separate table with each name and its code. What do I do next?

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,614
    This sort of thing is usually done within a form.
    The form would have a combo box which uses the table as lts Row Source property.
    It would show/auto fill with the Practice name.
    The form would also have a text box which references the second (probably hidden) column of the combo box which would be holding the Practice Code data.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,614
    Take a look at the attached db.
    Attached Files Attached Files
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870

  5. #5
    Aimee is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    19
    Thank you very much for your feedback - very helpful

  6. #6
    Aimee is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    19
    I think I am on the right track with the 'design' now, and have created the form with a combo box/drop down menu for the practice name.

    I have added a text box for the practice code, but how do I make this display the corresponding code automatically once I have selected the name?

  7. #7
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Without a picture or some code and a clear statement of your business rules, it is difficult to offer advice.

  8. #8
    Aimee is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    19
    Quote Originally Posted by orange View Post
    Without a picture or some code and a clear statement of your business rules, it is difficult to offer advice.
    If I were to send you the file (minus any pt info of course), would you be able to help?

  9. #9
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870

  10. #10
    Aimee is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    19
    Apparently the file is too big - do you have an email address?

  11. #11
    Aimee is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    19
    I have tried to convert it to zip - Let me know if you get this..
    Attached Files Attached Files

  12. #12
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    The zip file is fine.
    Why do you have 2 copies of the Practice codes table?
    In plain English what does
    a) your database represent, and
    b) what is the purpose of your Form?

    You should research Primary key and Foreign key.
    see http://technet.microsoft.com/en-us/l.../ms179610.aspx

  13. #13
    Aimee is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    19
    I have an extra table with the practice codes because I thought that I might have to create some kind of relationship or junction for access to know which code goes with each practice name.
    ...I have obviously gone completely wrong somewhere because when I type the practice name into the form, this now changes into the code.

    My database tracks the process of care for each patient receiving treatment. This information needs to be filled out by form. Both the practice name and code of where the patient is being treated need to be recorded, but rather than entre this manually I was hoping that there was a way for Access to recognize that each practice name relates to a specific code, and for this to be displayed on the form and database automatically.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. UNION qry dont work as expected.
    By rncarterjm in forum Queries
    Replies: 10
    Last Post: 04-02-2013, 07:53 AM
  2. Where two things DONT match
    By stephenaa5 in forum Queries
    Replies: 3
    Last Post: 11-09-2012, 03:51 PM
  3. Replies: 2
    Last Post: 03-29-2012, 02:19 PM
  4. Oat-so-simple but i dont have a clue
    By turbo910 in forum Forms
    Replies: 13
    Last Post: 11-26-2009, 12:28 PM
  5. Criteria from Combobox dont work.
    By Ryan in forum Queries
    Replies: 3
    Last Post: 08-31-2009, 07:09 AM

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
  •  
Other Forums: Microsoft Office Forums