Results 1 to 3 of 3
  1. #1
    tbalci is offline Novice
    Windows 8 Access 2013
    Join Date
    Oct 2014
    Posts
    5

    cannot add record(s); join key of table not in recordset

    Hello,

    I'm trying to build a simple CRM database. I have attached it to this message.



    I created a form to enable the user to enter company information. The name is frm_company. Within the form, there is a listbox which allows the user to select one or more tags for the company (lst_tag). There is another listbox, to enter one or more sector information for the company (lst_sector).

    The first problem I ran into is that the form does not display information from the connected tables.

    The second problem is lst_tag. When I try to select a value, it displays "cannot add record(s); join key of table 'tbl_companytag' not in recordset" error. Checking the form's Record Source, I see tbl_companytag in the records.

    I'm more than confused

    Anybody can give me a hand?

    Thank you,
    Tolga
    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,525
    Your frmCo is too complex. you need a table: tblCO ONLY connected to this form.
    the sector info goes into tblSector (it has the CO.CoID field)
    the form frm_Co is connected to tblCO


    1. is the form.recordsource connected to the correct table? that table...tbl_CO?
    2. does the table lst_companytag' have the co. key from tbl_CO?
    3. you cannot add items to lst_companytag' until there is a company record in tbl_CO to match it to. Is this so>?

  3. #3
    tbalci is offline Novice
    Windows 8 Access 2013
    Join Date
    Oct 2014
    Posts
    5
    Hi ranman,

    Thank you for your reply.

    1. My frm_company records data for 5 tables: tbl_company, tbl_companylink, tbl_companynote, tbl_companysector and tbl_companytag. I wanted to make data entry simple for the user, that's why I consolidated all into one form. If, as you said, this form is too complex for such an operation, would it be better to go with subforms rather than having everything on one form?

    2. What I want to do with the listbox lst_companytag is to record CompanyID and TagID to tbl_companytag. There can be multiple tags for one company. I want the user to select tags for the company from lst_companytag (this is exactly the same for lst_companysector). To reply your question, tbl_co does not have lst_companytag data.

    3. Following #2 above, lst_companytag records tags for the companies. Yes, there must be a company to record tag information.

    Just some notes: I can make design changes to the database, no problem. I want to future-proof it, I want a solid foundation so that when it grows I do not want to go back and make changes. On the other hand, I do not have any VBA knowledge, so I need to go drag-and-drop most of the time.

    Thank you for your assistance

    Tolga

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

Similar Threads

  1. Replies: 6
    Last Post: 07-24-2014, 04:01 PM
  2. Replies: 18
    Last Post: 06-01-2013, 02:26 PM
  3. Replies: 9
    Last Post: 04-12-2012, 07:25 AM
  4. Join Key of table in recordset
    By Rohit0012 in forum Forms
    Replies: 14
    Last Post: 09-24-2011, 09:04 PM
  5. Replies: 5
    Last Post: 09-19-2011, 12:01 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