Results 1 to 5 of 5
  1. #1
    vincentsp is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2015
    Posts
    29

    Updating textbox - combobox per record

    Hi All,



    In my form I have created a textbox which shows me the information from a combobox using a AfterUpdate event.
    This works fine but once I go to any other record in the database the textbox keeps the value from the last saved record.

    How do I get the textbox save the specific value chosen from the combobox per record.
    This would also help me using the textbox values in my query later on.

  2. #2
    NTC is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2009
    Posts
    2,392
    It sounds like your textbox is not bound. If that is the case then use a different technique. Do not write into it using the Afterupdate event. Instead source is on the combobox i.e.: =Me.ComboboxName.column(2)
    ....I just made up the number 2 - you'll of course use whichever value is correct.....

    In this way the text box will change value each time you change record and the value of the combobox changes

  3. #3
    vincentsp is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2015
    Posts
    29
    Thanks for your fast reply. It solves part of my problem.
    The values in my textbox controlled by the combobox are correct now and saved per record!.
    But in my query it does not show the textbox value per record, but gives the textbox value of the selected record in my form for each record in the query.

  4. #4
    amrut is offline Expert
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2012
    Location
    India
    Posts
    616
    The values in my textbox controlled by the combobox are correct now and saved per record!.
    Since the textbox is unbound as predicted by NTC, the text box is only displaying the value based on combo box value and not saving it. To save it, the control source of the text box should be a field from the table on which the form is based.

  5. #5
    vincentsp is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2015
    Posts
    29
    Thanks a lot I created a bound textbox and I'm able to use the value in my query as well.

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

Similar Threads

  1. Textbox instead of Combobox
    By jzacharias in forum Forms
    Replies: 4
    Last Post: 10-24-2012, 08:57 PM
  2. Replies: 2
    Last Post: 03-01-2012, 03:11 PM
  3. Updating record based on textbox entry
    By timmy in forum Programming
    Replies: 16
    Last Post: 04-06-2011, 12:05 AM
  4. Replies: 1
    Last Post: 12-17-2010, 04:25 PM
  5. Combobox not updating
    By lostfan789 in forum Forms
    Replies: 15
    Last Post: 06-16-2010, 09:21 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