listboxes

kingsgambit

Registered User.
Local time
Today, 19:47
Joined
May 27, 2001
Messages
134
I have a listbox on a form which connected to a query, this shows pay no, first name, last name.
Is they a way to get a query to llok at the second and third colum.
If I put in forms![searchform]![mylistbox] it only shows the first column.
 
That's because a list box has only one value.

If your original query is named qryPayroll a query that shows the three fields in your list box source would look like

SELECT * FROM qryPayroll WHERE PayNo = [forms]![searchform]![mylistbox]

(To make this work: (1) change qryPayroll to the correct name of your original query, (2) paste the SQL into a new query's SQL view, (3) Open [searchform] and select someone in the list box, then (4) open the new query from (2) in datasheet mode.

HTH,
Jim
 
One way is to use

forms![searchform]![mylistbox].column(1) for column 2, and

forms![searchform]![mylistbox].column(2) for column 3.

Note that column 1 is

forms![searchform]![mylistbox].column(0) or
forms![searchform]![mylistbox]
 

Users who are viewing this thread

Back
Top Bottom