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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Filtering fields to a list box after searching for a record

Status
Not open for further replies.

Magnetar

Programmer
Sep 22, 2001
73
GB
Afternoon

I wonder if someone could advise on the following:

I need to display certain field values within a list box, having searched for the relevant record which include those fields. To explain more clearly:

Underlying query, Q for example, has records X, Y Z.

Underlying query attached to form, gives results:

X field A
X field B
X field C

Y field D
Y field A
Y field B

Z field E
Z field F
Z field A

The user enters and searches for required record, Y say, which (I would like!) should display all relevant fields in list box, as follows:

field D
field A
field B

Everything works find, - except the list box.

Using the SQL builder for the Row Source of my list box, as follows, displays ALL the fields for each of the above records X, Y and Z:

"SELECT DISTINCTROW [Q].[field] FROM [Q]"

I want to filter for and hence display ONLY those fields pertaining to record Y. Can this be achieved using SQL, or will I have to write more VBA at this stage? (I want to avoid using v Basic if I can!).


Cheers Magnetar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top