Results 1 to 5 of 5
  1. #1
    Join Date
    Dec 2007
    Location
    Ohio
    Posts
    11

    Drop down question.

    I have a clinical form were all the data is bound directly to its own corresponding table. In the header of this form I have two lookup fields referncing a different table containing patient id and name: [PatientID] and [PatientName]. I would like to be able to select a patient ID# from the [PatientID] lookup field on the form and have the [PatientName] field automatically filled in with the corresponding patient name. Pretty standard stuff, but I don't know how to do it. Thanks in advance.

  2. #2
    jya is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Sep 2007
    Location
    Chicagoland
    Posts
    109
    I'm not sure I understand what you are looking for.

    If I understand correctly, you have one table that is bound to the form. You have another table you use for a dropdown box. Are you looking for the form to display the record that corresponds to the Patient ID that you select in the dropdown or do you just want to populate an unbound field with a corresponding value(i.e. patient name)? I'm assuming that the two tables are related to each other with the patient ID. Is this correct?

  3. #3
    Join Date
    Dec 2007
    Location
    Ohio
    Posts
    11

    You are correct.

    Thanks for the reply. Let me explain it a different way. I want to gaurantee that the patient ID and patient name are not incorrectly entered on the form (i.e the id does not match the name, etc.). The patient ID is bound to the table, but the patient name field does not have to be because that info is in the patient table. However, since this form is to be printed, I need the name to display on the form. Boy, communicating about a database can be hard. Thanks again.

  4. #4
    jya is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Sep 2007
    Location
    Chicagoland
    Posts
    109
    In one of the event procedures, I would use the DLookUp function to populate the patient name field.
    ex.
    Me!txtPatientName = DLookUp("patient name","patient","[patient ID] = " & Me![cboPatientID])

    Of course, this wouldn't prevent someone from writing over this unless you disabled this field.

  5. #5
    Join Date
    Dec 2007
    Location
    Ohio
    Posts
    11

    Thank You!

    I had read about the Dlookup function in my books, but was not sure if it was right or not. You answered my question. Thank you so much for your help.

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

Similar Threads

  1. drop down issues
    By gromit95 in forum Access
    Replies: 3
    Last Post: 07-21-2008, 08:14 AM
  2. Drop Down Menus
    By iambia in forum Access
    Replies: 1
    Last Post: 01-25-2008, 02:05 PM
  3. Drop down box requery problem
    By Nicholas in forum Forms
    Replies: 1
    Last Post: 08-11-2006, 11:42 AM
  4. form drop down
    By arianhojat in forum Forms
    Replies: 0
    Last Post: 06-01-2006, 11:56 AM
  5. Drop Down, link to another dropdown
    By davelliott in forum Forms
    Replies: 3
    Last Post: 05-23-2006, 08:05 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