Results 1 to 9 of 9
  1. #1
    snowygirl1 is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Oct 2016
    Posts
    10

    Lookup field to display more details

    I have a form I've set up for some courses.
    I have set up a table for "courses" and another table for "venues" as we may use the same venue for multiple courses.
    Whenever I create a new course, I want to select a venue from a lookup field (which is linked to the courses tables), and then have the address and other information pulled from the venue table and just displayed on the form. I cannot get it working.

    Any suggestions???

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 7 32bit Access 2013
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,614
    On a form, use a combo box based on the venue table, to select the venue. The combo and be set to include all the fields from the table but hidden. Text boxes on the form can then reference the different (hidden) columns of the combo as their Record Source property. Remember that the columns are numbered starting with zero. So first column is =MyCombo.Column(0) second column is MyCombo.Column(1) etc
    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
    snowygirl1 is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Oct 2016
    Posts
    10
    Ok I have created the combo box but I'm not sure how to hide all the fields with the exception of the venue name.
    Here is the row source: SELECT [tbl_Venue].[VenueID], [tbl_Venue].[Venue Name], [tbl_Venue].[Address], [tbl_Venue].[Suburb], [tbl_Venue].[State], [tbl_Venue].[Postcode], [tbl_Venue].[Contact Name], [tbl_Venue].[Contact Email], [tbl_Venue].[Contact Phone] FROM tbl_Venue ORDER BY [Venue Name];

  4. #4
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 7 32bit Access 2013
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,614
    Change he Column Widths property of the combo to something like: 0cm;2;0cm;0cm;0cm;0cm;0cm;0cm;0cm;

    You'll probably want to reduce the List Width Property as well.

    Simple example attached:
    Attached Files Attached Files
    Last edited by Bob Fitz; 06-10-2017 at 02:53 AM. Reason: More info
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  5. #5
    snowygirl1 is offline Novice
    Windows 10 Access 2016
    Join Date
    Oct 2016
    Posts
    10
    Thank you Bob. I have managed to get it working thanks to your assistance. Greatly appreciated.

  6. #6
    snowygirl1 is offline Novice
    Windows 10 Access 2016
    Join Date
    Oct 2016
    Posts
    10
    Opps no one more issue. When i allocate the venue for each course, it is not saving this. So if i exit out of the form and go back in the venue is blank again.

  7. #7
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 7 32bit Access 2013
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,614
    Quote Originally Posted by snowygirl1 View Post
    Thank you Bob. I have managed to get it working thanks to your assistance. Greatly appreciated.
    You're welcome. Glad I was able to help
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  8. #8
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 7 32bit Access 2013
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,614
    Quote Originally Posted by snowygirl1 View Post
    Opps no one more issue. When i allocate the venue for each course, it is not saving this. So if i exit out of the form and go back in the venue is blank again.
    Sounds like you need to set the Control Source property of the combo to the appropriate field of the forms Record Source
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  9. #9
    snowygirl1 is offline Novice
    Windows 10 Access 2016
    Join Date
    Oct 2016
    Posts
    10
    Sorry yep realised that after I'd replied.. All working now. Thank you for your time.

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

Similar Threads

  1. Lookup field display
    By LaughingBull in forum Access
    Replies: 7
    Last Post: 01-07-2017, 07:55 PM
  2. Details will not display in alphabetical order in 2016
    By Edward Austin in forum Reports
    Replies: 1
    Last Post: 04-27-2016, 08:00 PM
  3. Replies: 3
    Last Post: 10-28-2015, 12:38 PM
  4. Replies: 1
    Last Post: 03-03-2012, 09:45 PM
  5. Replies: 6
    Last Post: 10-20-2011, 11:27 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