Data does not update to table

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cheweedog
    New Member
    • Jan 2010
    • 10

    Data does not update to table

    I have a form with a combo box. I also have a expression in a text field to paste the data from the combo box into the specific field. This works, but the data does not update/refresh to the table. How to fix this issue.
  • missinglinq
    Recognized Expert Specialist
    • Nov 2006
    • 3533

    #2
    My guess would be that you have this expression in the Control Source for the textbox. You need to move the code from there, make the Control Source the field in the underlying table where you want to store this data, then place your expression in the Combobox AfterUpdate event. Something like

    Me.TextBoxName = Me.ComboboxName .Column(x)

    where X is the number for the appropriate field in the Combobox. Remember that the fields, running left-to-right in the dropdown, start at zero.

    Welcome to Bytes!

    Linq ;0)>

    Comment

    • cheweedog
      New Member
      • Jan 2010
      • 10

      #3
      Thank this did work, but how would this work with multiple fields to auto populate the table? I entered
      Code:
      Private Sub Combo26_AfterUpdate()
        Me.UPC_Code = Me.Combo26.Column(2)
      End Sub
      Would I enter another Me statement to this code, like Me.txtboxname=M e.comboboxname. column(x)

      Comment

      • missinglinq
        Recognized Expert Specialist
        • Nov 2006
        • 3533

        #4
        Exactly!

        Code:
        Private Sub Combo26_AfterUpdate()
           Me.UPC_Code = Me.Combo26.Column(2)
           Me.AnotherField = Me.Combo26.Column(3)
           Me.YetAnotherField = Me.Combo26.Column(4)
        End Sub

        Comment

        • cheweedog
          New Member
          • Jan 2010
          • 10

          #5
          Thank you very much. I did try this method and it works great.

          Comment

          • missinglinq
            Recognized Expert Specialist
            • Nov 2006
            • 3533

            #6
            Glad we could help!

            Linq ;0)>

            Comment

            Working...