Results 1 to 4 of 4
  1. #1
    Join Date
    May 2008
    Saginaw, Texas

    Unanswered: Help Issue with Selection of row data

    I have a form with combo box to select a part number and multiple fields attached to the number selected (see attached image). I use code to fill in the remaining fields of row data selected. Code below
    Private Sub ID_Part_AfterUpdate()
    Me.ID_Part = ID_Part.Column(0)
    Me.Part_Desc = ID_Part.Column(2)
    Me.Qty = ID_Part.Column(3)
    Me.Price = ID_Part.Column(4)
    Me.PurchaseDate = ID_Part.Column(5)
    Me.PurchaseInv = ID_Part.Column(6)
    Me.ID_Supplier = ID_Part.Column(8)
    Me.ID_Purchases = ID_Part.Column(7)
    End Sub
    Problem occurs when the part number is duplicated but has different purchase dates and invoices attached. When you select a part number it will only bring in data from the top row even if the highlighted row is not the top row. How do I clarify the selection process?
    Attached Thumbnails Attached Thumbnails Data Select.png  
    "Discovery consist in seeing what everyone sees and thinking what nobody has thought"

  2. #2
    Join Date
    Jun 2005
    Richmond, Virginia USA
    Provided Answers: 19
    Given the code posted, this really doesn't make much sense; the code should fill in the Fields using that Combobox selection's values.

    If, on the other hand, you were using the native Combobox function to retrieve a Record, based on the Part_ID, the code generated uses the code


    which does just that…finds the first Record where, in this case, the Part_ID matches the Part_ID of the Combobox selection, and if the selection you actually made isn't the first occurrence of that Part_ID, but rather is the second occurrence, in that particular Recordset, it'll retrieve the wrong Record, which is exactly what you're describing, here!

    Linq ;0)>
    Hope this helps!

    The problem with making anything that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  3. #3
    Join Date
    May 2008
    Saginaw, Texas
    Thank you for your reply, I thought if I placed the code in the combo box after update event that it would select the highlighted row of data. Was I wrong in my assumption? If so how do I code the selection process to pick the highlighted row?

  4. #4
    Join Date
    Nov 2004
    out on a limb
    Provided Answers: 59
    examine the properties of the combo object
    look for the selected property
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts