Page 2 of 2 FirstFirst 12
Results 16 to 22 of 22
  1. #16
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,566
    If you have setup your Combobox correctly the name will be displayed vice the ID



    Can you upload your db?
    You can PM me if you need further help.
    Good Reading https://docs.microsoft.com/en-gb/off...on-description

  2. #17
    Minty is offline VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,003
    @LeonS You have been told at least 3 times that you store the ID.

    On your search form you simply repeat the combo so your end users see the Country / Industry TEXT value, but the combo presents the stored ID as the search criteria to the query.
    This is 100% the correct way to do this.

    Your master table should only have the Country ID or Industry ID stored as a foreign key, never the text as well.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  3. #18
    LeonS is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jul 2014
    Posts
    115
    Hello! Let me start by apologising to all that have tried to help me with the ComboBox. I am now trying to create a new ComboBox based on what has been told me. I now realise that the entry in the Master1 table should be the Industry number NOT the text. I will then try to run the query. I expect the "Please write the name of the Industry" message box to appear and for me to insert the Text (eg Media) in that box. And press OK. I then expect a table containing the name of the person in that Industry to appear in an Excel spreadsheet which shall be exported to my Desktop. Back soon. Leon

  4. #19
    LeonS is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jul 2014
    Posts
    115
    Hello, again. I have recreated a new ComboBox as per the Wizard. The Field Industry accepts the word "Law" and that word's ID number is saved in Master1. So far, so good. When I run the Query, if I enter Law, I get nothing. If I enter 15 (the ID for Law) I get those people in the Law. How do I change my Query/ ComboBox so inputting the Text will give the answer I want?

  5. #20
    LeonS is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jul 2014
    Posts
    115
    Hello, again. I have recreated a new ComboBox as per the Wizard. The Field Industry accepts the word "Law" and that word's ID number is saved in Master1. So far, so good. When I run the Query, if I enter Law, I get nothing. If I enter 15 (the ID for Law) I get those people in the Law. How do I change my Query/ ComboBox so inputting the Text will give the answer I want?

    Click image for larger version. 

Name:	IndustryQuery.jpg 
Views:	9 
Size:	85.1 KB 
ID:	46140

  6. #21
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,566
    You should add the table tblIndustries to the query - Join On IndustryID - then add the Industry Field from tblIndustries. - then add the criteria [Enter Industry] in the Industry Column.

    The Industry field should be deleted from Master1
    You can PM me if you need further help.
    Good Reading https://docs.microsoft.com/en-gb/off...on-description

  7. #22
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    That was explained in post 9. Putting it another way, in a query you join the lookup table ID (the autonumber Primary Key field) field to the Master1 Industry field (Foreign Key containing the PK values from lookup table). Enter "Law" in the lookup table field for industry, not the ID field. Your query then finds Law, which is equivalent to saying wherever 2 = 2 (or whatever Law autonumber is).

    The Industry field should be deleted from Master1
    Or if there are already records, converted to numbers as text (the PK values from Industry lookup table) using an update query, then the field property changed to long.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Adding a combo box gives me an error message
    By gutenberg in forum Forms
    Replies: 1
    Last Post: 07-26-2016, 12:00 PM
  2. Replies: 7
    Last Post: 03-17-2016, 05:53 PM
  3. Replies: 14
    Last Post: 03-31-2015, 05:20 PM
  4. Replies: 3
    Last Post: 10-30-2013, 05:59 AM
  5. Combo box error message
    By pbouk in forum Forms
    Replies: 5
    Last Post: 05-08-2013, 07:02 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