open a form for a particular result of list

  • Thread starter Thread starter kelvin H via AccessMonster.com
  • Start date Start date
K

kelvin H via AccessMonster.com

There is a list (lstShow) with many columns, in my form (frmShowlist), that
shows the result from particular query.
And productID is shown on the first column of the list result.

What I'm trying to do is: when user click on that row of list result, it
display another product detail form (frmDetail) according to that product ID
clicked.

How can it be done?
 
Put logic in the AfterUpdate event of lstShow that opens frmDetail, passing
it a product Id:

Private Sub lstShow_AfterUpdate

DoCmd.OpenForm "frmDetail", , , "productID = " & Me!lstShow.Column(0)

End Sub

That assumes that productID is numeric. If it's text, use "productID = " &
Chr$(34) & Me!lstShow.Column(0) Chr$(34)
 
Back
Top