Results 1 to 6 of 6
  1. #1
    Join Date
    Sep 2005
    Location
    Utah
    Posts
    136

    Unanswered: Text box = specific field from specific record based on combo box selection.

    I have a text box on a form that I would like to populate with information from a record based on what has been entered into a combo box.

    I have tried every syntax I could think of and keep getting #Name?

    Ok, the user selects an item from the combo box. The item selected is a field of a record in a table. I want the text box to populate with another field from the same record from the same table.

    User selects Field X from Record Y from Table A. I want the text box to populate with Field XX from Record Y from Table A.

    I hope I used the letters in the above paragraph correctly. New at explaining things that way.

    Thanks!!
    Last edited by Zenaida; 11-29-05 at 17:05.

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Post your current code please.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  3. #3
    Join Date
    Sep 2005
    Location
    Utah
    Posts
    136
    SELECT Items.Updated FROM Items WHERE (((Items.ItemName)=Forms!Procedures!ItemName));

    Sorry about that.

    Thanks
    Last edited by Zenaida; 11-29-05 at 18:14.

  4. #4
    Join Date
    Sep 2005
    Location
    Utah
    Posts
    136
    I keep playing with it and I can't figure out what syntax I need to use. My head is turning into mush at this point.

  5. #5
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Your syntax is correct. I would check the names of your controls, also make sure you referencing the proper column of your combo box if it has multiple columns...

    Also, "Parameter" is a reserved word in Access. It is generally considered best practice to avoid using reserved words in your code for objects/functions.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  6. #6
    Join Date
    Sep 2005
    Location
    Utah
    Posts
    136
    I changed the name of my form. Thanks for the tip.

    How I was trying to get this to work was to have all the information on the same form. Don't know what I'm doing wrong, so I tried something else.

    I left the two combo boxes on the form and moved the other text boxes on the form to a second form. Then I placed a command button on the first form labeled Display.

    The user will make their selections in the first form and then click on Display and another form will open with the information.

    Still not sure why it works this way and not the other way. My brain is too tired to think about what I did on the first form compared to how I'm doing it now. I'll come back to it later to see if I can figure that out.

Posting Permissions

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