Results 1 to 5 of 5
  1. #1
    Geekpros is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Mar 2018
    Posts
    2

    Question Combo Box works with Row Source until I try to filter it

    Willing to PAY 100hr for remote access mentor help. I give you access, you help, and I pay on paypal...

    Question
    _______

    This combo box row source works as it doesn't need a filter: SELECT tbl1Employees.ID, [FirstName] & " " & [LastName] AS Expr1 FROM tbl1Employees;

    This one works until it needs a requery or something: SELECT tbl1Addresses.ID, tbl1Addresses.AddressLine1 FROM tbl1Addresses WHERE (((tbl1Addresses.Customer_ID)=[Forms]![frmInvoice]![ID]));



    I need the combo box to allow me to select and address from the address table that belongs to that customer ID. It works for the 1st customer that comes up but then when I use the navigation buttons at the bottom to go to the next record, the addresses that are available for the next invoices are the addresses from the 1st record that was in that form. I've tried a me.requery on update but that didn't work. I've gone through all the Steve Bishop videos and I'm missing something simple here.

    Willing to pay 100hr to any mentor out there that want's to help me. My phone is on geekpros.net. I need about 10 hours of help over a month. So $1k to the mentor.

    Thanks
    Last edited by Geekpros; 03-06-2018 at 08:57 PM. Reason: Solved

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    This is a known and frequently discussed issue when using cascading (dependent) comboboxes with lookup alias on continuous or datasheet form. If you search forum you will see quite a few threads on the topic.

    Have to requery the combobox, not the form.
    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.

  3. #3
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Maybe post your dB so we can see what you are doing??
    Only needs a few records; change any sensitive data.
    Do a "Compact & Repair", then zip it (see the sig on June's post)

  4. #4
    Geekpros is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Mar 2018
    Posts
    2
    I found that the problem is that I have a field called ID in 2 tables. I fixed that by renaming them to something like. Invoice_ID and Customer_ID. Then the error went away cause it was able to tell the difference between the two ID fields that were identical to the algorythm... even though they were ID fields in 2 different tables and properly specified. Access 2013 probably would have worked without this fix. I've opted to change my Foreign Key ID fields to Invoice_IDFK and customer_IDFK to simplify future errors based on this problem. I will never have 2 Key fields be the same between 2 tables.

    Now I question if I will ever have this type of problem with non key fields that could be identical from table to table and then later be involved on a single form or subform. I'll check before I move forward.

    Probably nothing on my database accept the company name to remove to make it public. I'll do that for future requests. Thanks for your trying to help. Can't believe I got a response from this forum within minutes. So Cool!

  5. #5
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Glad you figured it out.

    For the primary key fields, I use a suffix of "_PK". So I would name the fields InvoiceID_PK and CustomerID_PK. The "ID" in the field name (for me) means that the field is a number field and because it is a PK field, it also means it is an autonumber type field.

    For the foreign key fields, I use a suffix of "_FK". So the FK field names would be InvoiceID_FK and CustomerID_FK. In this case, "ID" just means it is a number field.

    And you are correct. There should never be 2 or more fields with the same name due to the ambiguity it causes.


    Good luck with your project........

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

Similar Threads

  1. Replies: 2
    Last Post: 03-18-2016, 08:39 AM
  2. Replies: 12
    Last Post: 01-15-2016, 09:42 AM
  3. Replies: 2
    Last Post: 10-21-2014, 07:57 AM
  4. Replies: 1
    Last Post: 11-28-2013, 10:03 PM
  5. Replies: 14
    Last Post: 05-25-2012, 02:40 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