Results 1 to 7 of 7
  1. #1
    msmithtlh is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    151

    Trying to search and find a record, but it is somehow updating a record incorrectly

    I have a table for businesses, which includes an ID field (autonumber), a business category, a name and some other fields. I want the user to select a category in the first combo box. In the second combo box, I want the user to be able to select the business name from all the businesses in the selected category. Then, find the record, displaying the ID field, category, and name.



    This seems very straight forward, but everything I have tried does NOT work. The bizarre thing is that it seems to update or create a record, putting the ID number in the name field.

    I have tried multiple approaches, none of which are working. I've been working on this for a couple of weeks, and need to get past this and on with the rest of the program.

    I stripped out the extraneous objects and have attached the database.

    Your help will be greatly appreciated!!!testCAJM.zip

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,925
    The combos should not be bound.
    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

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,919
    Controls used to input/select filter criteria should be UNBOUND, otherwise data in record is changed - as you have discovered.
    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.

  4. #4
    msmithtlh is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    151
    I tried using unbound fields, but had problems.

    I need the 1st combo box to lookup category value from Buscategories!Buscategory.
    I need the 2nd combo box to lookup business name from Businesses!BusinessName where Businesses!BusCategory = value in the 1st combo box.
    After the 2nd combo box is selected, I want to display the Businesses!BusinessID field.

    Can you give me help with the VBA code? Thanks!!

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,919
    You describe cascading combobox - a common topic.

    Do you want to use these comboboxes to filter form records?

    Exactly what problems did you have?

    I will try to look at your file tonight, if no one else provides solution.
    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.

  6. #6
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,411
    smith-test-davegri-v01.zip

    Attached DB is as below changes:

    Click image for larger version. 

Name:	combos.png 
Views:	16 
Size:	25.5 KB 
ID:	47995

    Made changes to schema

    Click image for larger version. 

Name:	rels.png 
Views:	16 
Size:	29.7 KB 
ID:	47996

  7. #7
    msmithtlh is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    151
    Thank you so much!!!!!!!!!!!!

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

Similar Threads

  1. search/find/select record before delete/update
    By wtolentino in forum Forms
    Replies: 3
    Last Post: 07-10-2017, 06:09 PM
  2. Replies: 3
    Last Post: 03-09-2017, 08:48 AM
  3. Replies: 8
    Last Post: 08-30-2016, 06:02 PM
  4. Replies: 11
    Last Post: 02-22-2015, 01:25 PM
  5. Replies: 1
    Last Post: 01-12-2011, 10:11 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