SteveL13
asked on
How open form to selected record in a listbox
I'm trying to open a form (form #2) to a selected record in a listbox in form #1.
Here is my code which doesn't work...
DoCmd.OpenForm "frmPlantedBayQtys", , , "[PlantedBayID] = " & Chr(34) & Me.ListBayQty.Column(1) & Chr(34)
Note that PlantedBayID in numberic.
Here is my code which doesn't work...
DoCmd.OpenForm "frmPlantedBayQtys", , , "[PlantedBayID] = " & Chr(34) & Me.ListBayQty.Column(1) & Chr(34)
Note that PlantedBayID in numberic.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Are you really interested in the 2nd column of the listbox, or the one that is the bound column? Listboxes are zero based, so by referring to column(1) you are actually looking at the 2nd column in the Listboxes RowSource.
is the field [PlantedBayID] a number or a string? if it is a number, Capricorn1's example above should work.