Results 1 to 11 of 11
  1. #1
    zmbaker is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2014
    Posts
    31

    Combobox and data entry text box


    I have created a form with a combo box that pulls records from a table. Then I have a text box to enter that name of the company to be entered with the matching record. And a save button to save the event.

    Instead of my combo box and text box updating the record, it update the first record in the table instead of finding the record that matches the combo box. Any ideas what I did wrong?

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,549
    Is sounds like you have the FORM connected to a table. (it always starts a rec#1)

    Remove the data source from the form, then when you pick the cbo and text fields, run an update query with these values.

  3. #3
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    why would you need two controls (text box and combo box)

    Assuming you have a primary key (let's say a customer table with a customerID (autonumber) and a customer name).

    If you are using a bound form you can create a combo box that is bound to the customer ID field of your target table (customer orders perhaps) and set the combo box to have two columns, Customer ID and CUstomer name, then set the widths to 0,2 (for example) The customer name will appear in the combo box and the actual data stored would be the customer ID.

    If you are trying to use the combo box to search for records relevant to a specific choice that's a different matter but I'm not entirely sure I've understood your post.

  4. #4
    zmbaker is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2014
    Posts
    31
    I have another database that has a table as the record source that updates the specific record though, I just cant seem to get this one to do the same thing

  5. #5
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    perhaps if you provide a sample database we can take a look at it.

  6. #6
    zmbaker is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2014
    Posts
    31
    The combo box searches for a records for a specific choice then the text box updates the name field in the table. For example the combo box has categories and I have a user to reviews the categories but it isnt necessarily in order so the combobox find the record then the text box records who reviewed the category.

  7. #7
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    so why not provide a cascading combo box, so when the user changes the choice in the first combo box, a list of valid categories for that selection appears in the second combo box, then, assuming this narrows your search to 1 record you wouldn't have to navigate to a specific record at all.

  8. #8
    zmbaker is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2014
    Posts
    31
    Example.zip

    Here is the example i have

  9. #9
    zmbaker is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2014
    Posts
    31
    How do you create a cascading combo box? The other problem would be I still need the date associated with the change

  10. #10
    zmbaker is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2014
    Posts
    31
    I solved the issue i just created a searchforrecord macro

  11. #11
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    all you need to do is in the ON CHANGE event of your combo box click the the expression builder (three dots on the far right of the row), create some code (one of the options)

    type in: me.requery

    whenever you chagne the selection of the combo box the relevant record will be brought up.

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

Similar Threads

  1. Replies: 5
    Last Post: 03-09-2014, 07:16 PM
  2. Replies: 7
    Last Post: 02-08-2014, 12:31 PM
  3. Replies: 2
    Last Post: 05-20-2013, 05:23 PM
  4. Replies: 2
    Last Post: 12-21-2010, 12:03 AM
  5. Replies: 1
    Last Post: 02-10-2007, 10:21 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