Results 1 to 4 of 4
  1. #1
    18khattaba is offline Novice
    Windows 10 Office 365
    Join Date
    Jan 2023
    Posts
    1

    Auto input data in a field in a form using relationships


    I have two tables and one is for customers and the other is for prices of hotels. For every location, there is one hotel. In the customers form, I wold like it to auto select the hotel when the user selects a location. I would like to do this using relationships.

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,543
    Quote Originally Posted by 18khattaba View Post
    I have two tables and one is for customers and the other is for prices of hotels. For every location, there is one hotel. In the customers form, I wold like it to auto select the hotel when the user selects a location. I would like to do this using relationships.
    Cross posted: https://www.access-programmers.co.uk...nships.326199/


    Please read: https://excelguru.ca/a-message-to-forum-cross-posters/
    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
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,933
    Use a combobox and bring in the Location and Hotel.
    When a combo item is selected, set the Hotel from that row.
    Combos start at 0.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,926
    So selecting location selects hotel?

    Combobox can have a RowSource that displays both location and hotel info.

    SELECT ID, Location & " : " & Hotel AS LocHot FROM Hotels;

    Bind combobox to field you want to save the ID into.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 2
    Last Post: 08-29-2018, 09:10 AM
  2. Replies: 3
    Last Post: 11-29-2016, 10:03 AM
  3. Auto-populate data based on an input value
    By taybo93 in forum Access
    Replies: 12
    Last Post: 07-28-2016, 06:10 PM
  4. Replies: 4
    Last Post: 02-15-2016, 09:34 PM
  5. Replies: 3
    Last Post: 10-23-2012, 09:04 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