I am currently working on code in a module that once you make a selection in a listbox it will open up an email with the selection from the listbox populated in a table. Right now my code is bringing back everything that is in the access table and not just the selection in the listbox. I am using the below code. I don't think that it is recognizing the listbox and it is just pulling the information from tblTrucks.
strSQL = "SELECT * FROM tblTrucks WHERE ([ID] = " & Forms!Main.lstorders.Column(0, i) & " )"
Set rst = CurrentDb.OpenRecordset(strSQL)
Not sure if you need more information or not. Any help would be appreciated.
Thanks!
strSQL = "SELECT * FROM tblTrucks WHERE ([ID] = " & Forms!Main.lstorders.Column(0, i) & " )"
Set rst = CurrentDb.OpenRecordset(strSQL)
Not sure if you need more information or not. Any help would be appreciated.
Thanks!