Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I reference the 4th column v

Status
Not open for further replies.

cochise

Technical User
Mar 27, 2001
171
US
How do I reference the 4th column value (DateCriteria) in a table (tblReports) for the current record (ReportName) selected from a listbox (lstSelectReports).

My idea is to set the list boxes RowSource so that:

WHERE tblReports.DateCriteria = " & [4th column value]

Do I have to use a For Each ... Next statement?

Any help would be greatly appreciated.

 
Hi!

The general way to reference the fourth column of a list box is:

Forms!YourForm!YourListBox.Columns(3)

I am not sure that you can put this in the criteria of a query from the design view and still have it work. If you are using this the the criteria of a query, try typing it in SQL view. If you are setting up the query or criteria in VBA then the syntax above should work. This is assuming that the list box is not multi-select, if it is then the syntax becomes more complicated.

hth


Jeff Bridgham
bridgham@purdue.edu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top