I have a listbox that outputs some invoice data. I want to use the first column of the selected row to open another form.
I know how to do it with a combo box:
Dim stlinkcriteria As String
Dim stDocName As String
stDocName = "frmEditVehicle"
stlinkcriteria = "[VehicleID]=" & Me.CmbVehicle.Column(0,0)
DoCmd.Close acForm, "Customer"
DoCmd.OpenForm stDocName, , , stlinkcriteria
DoCmd.Restore
Works great, but how can I use a Listbox with the same type thing where it will say:
Me.LstVehicle.Column(SELECTED COLUMN,0) ?
How can I tell my criteria statement to equal whichever column that is selected number?
Thanks for you help!
--freefour
I know how to do it with a combo box:
Dim stlinkcriteria As String
Dim stDocName As String
stDocName = "frmEditVehicle"
stlinkcriteria = "[VehicleID]=" & Me.CmbVehicle.Column(0,0)
DoCmd.Close acForm, "Customer"
DoCmd.OpenForm stDocName, , , stlinkcriteria
DoCmd.Restore
Works great, but how can I use a Listbox with the same type thing where it will say:
Me.LstVehicle.Column(SELECTED COLUMN,0) ?
How can I tell my criteria statement to equal whichever column that is selected number?
Thanks for you help!
--freefour