Hi Christiane,
You need to concatenate the
value of the selected item to your SQL string. Right now, you're just passing the
text lbxEmployees.SelectedItem.Value to the SQL statement.
Try this instead (all on one line):
"SELECT TitleOfCourtesy, FirstName, LastName, Country, Region, City,
Notes FROM Employees WHERE EmployeeID = " &
lbxEmployees.SelectedItem.Value
Is EmployeeID a number? If it's not, you probably need to surround it by quotes:
"SELECT TitleOfCourtesy, FirstName, LastName, Country, Region, City,
Notes FROM Employees WHERE EmployeeID = '" &
lbxEmployees.SelectedItem.Value & "'"
HtH,
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to:
Distegration by
The Cure (Track 10 from the album:
Disintegration)
What's This?