Results 1 to 7 of 7
  1. #1
    tcormack is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2016
    Posts
    3

    Help Needed for Lookup Values

    Hi,

    I'm trying to create a database for joining instructions for training courses. Ideally I want the user to select the Hotel name from the drop down list and the hotel info would populate however I've not been able to make the lookups work.

    Any advice appreciated!

    TC
    Attached Files Attached Files

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    build a form with the details of the hotel. this will be the sub form.

    in the main form, put a combo box that has the hotels.
    under it put a subform box. set the rowsource to the subform above (the primay key field will be the combo box as the MASTER KEY)
    in the AFTERUPDATE event of the combo box, cboHotel, refresh the subform:

    Code:
    sub cboHotel_afterupdate()
       subFrm.requery
    end sub

  3. #3
    tcormack is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2016
    Posts
    3
    Hi,

    Thanks for that. I have attempted to do as you've said - I created the combobox with the hotel names (from the hotel table). When I tried to create the subform the only fields available to me were those in the employee section of the main form. Where might I be going wrong?

    Thanks

  4. #4
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    the sub form recordsource is Hotels tbl, not employee table

  5. #5
    JamesDeckert is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jul 2015
    Location
    Salina, KS
    Posts
    262
    Here's a youtube video on creating a Combo Box Lookup
    https://www.youtube.com/watch?v=nJXqMJC60oY

  6. #6
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    I have your hotel auto populate working, but you have many things wrong with your dB.

    I would suggest you work through the tutorials here. Don't just read - take the time to do them.

    Attached is your dB. Tear it apart to see what I did to make it work. Have fun
    Attached Files Attached Files

  7. #7
    tcormack is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2016
    Posts
    3
    Thanks Ssanfu!

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

Similar Threads

  1. More Than 1 Lookup Needed
    By dmd in forum Access
    Replies: 3
    Last Post: 11-06-2015, 03:31 PM
  2. Replies: 4
    Last Post: 07-28-2015, 10:14 AM
  3. Replies: 4
    Last Post: 04-25-2015, 10:29 PM
  4. Replies: 1
    Last Post: 08-05-2011, 05:16 PM
  5. Lookup Values
    By gjw1012 in forum Access
    Replies: 5
    Last Post: 07-22-2009, 08:56 AM

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