Thanks for replying guys. I think i confused things so I'll try and explain in a bit more detail.
I have a list box called List20 which has 7 fields within
it.
Originally the following code worked fine:-
Dim sqlstr1 As String
slstr1 = "SELECT [Learning Programme Dataset].LEARN_ID, "
sqlstr1 = sqlstr1 & " [Learning Programme
Dataset].PROVI_ID,"
sqlstr1 = sqlstr1 & " [Learning Programme
Dataset].lprog_id,"
sqlstr1 = sqlstr1 & " [Learning Programme Dataset].
[type_lpg], "
sqlstr1 = sqlstr1 & " [Learning Programme
Dataset].isf_LPROGSTART,"
sqlstr1 = sqlstr1 & " [Learning Programme
Dataset].isf_dueend,"
sqlstr1 = sqlstr1 & " [Learning Programme
Dataset].isf_actualenddate"
sqlstr1 = sqlstr1 & " FROM [Learning Programme Dataset]"
sqlstr1 = sqlstr1 & " WHERE [Learning Programme
Dataset].LEARN_ID = '" & Me.[LEARN_ID] & "'"
sqlstr1 = sqlstr1 & " AND [Learning Programme
Dataset].Provi_id = '" & Me.[PROVI_ID] & "';"
Me.List20.RowSource = sqlstr1
Underneath i have another list box called list18 which i
wanted the results of to be based on list20.
I was unsure where to put the code so at the end of my
first line i added a commar and wrote sqlstr2 as string.
At the bottom of the statement for List20 i started adding
the statement for List18, which is when i started having
all this trouble.
The fields i wanted on List18 where:-
Learn_id, Provi_id, Lprog_id, Title_la and so on.
These fields came from the Table [Learning Activity
Dataset], so i wanted Learn_id, Provi_id and Lprog_id from
the Learning Activity Dataset to be equal to those of
List20.
In list20 the above fields are columns 0,1 and 2 so i
tried saying:- Where [Learning Activity Dataset].Learn_id
= me.list20.column(0) and so on.
This did not work and brought up the error - The Select statement includes a reserved word or an
argument name that is mispelled or missing, or the
punctuation is incorrect, so i thought
it must be because of my list box. Next i tried adding
unbound text boxes which got there information from List20
and tried saying:- Where [Learning Activity
Dataset].Learn_id = me.text22 and so on, but i still had
the error.
I am unsure of how to make the second list box work, so any help will be greatly appreciated.
Thanks
Anthony