Drilling down in 3 list boxes

T

Teresa

I have a form, I want to make a selection from 3 different
list boxes. I then want to use the 3 selected values to
lookup to a record in another table, retrieve some data
and write the record. Can anyone point me in the right
direction, I seem to be running in circles!
 
J

Joshua

I would create a sql command with the values in all three
list boxes and then execute a docmd.runsql. Ex:

dim SQLString as string

SQLString = "SELECT
.[FIELD1],
.[FIELD2],
.[FIELD3] INTO TABLE2 WHERE (((
.[FIELD1])=
& LISTBOX1 & " AND (
.[FIELD2])= & LISTBOX2 & " AND
(
.[FIELD3])= & LISTBOX3 & "));"

DOCMD.RUNSQL SQLSTRING
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top