A
Ant. W
Is it possible to base a list boxes results on another
list box?
The reason is I have tried to do this and failed miserably.
On my form i have a list with the following Select
Statement on the On Current Event of my form:-
Dim sqlstr1 As String
sqlstr1 = "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
This works fine.
What i am confused on is how i would base my the new list
box on the first one or how i would start the next
statement.
The fields i would like are:-
Learn_id
Provi_id
Lprog_id
Title_la
and they come from a table called [Learning Activity
Dataset].
What i would like to say Select the above fields from
Learning Activity Dataset where Learn_id = me.list20.column
(0), but am unsure how to start after the first list box
statement has finished.
Also i beleive i may have a timing issue as they are both
trying to run at the same time.
Can anyone please help me.
Thanks Everyone
Anthony
list box?
The reason is I have tried to do this and failed miserably.
On my form i have a list with the following Select
Statement on the On Current Event of my form:-
Dim sqlstr1 As String
sqlstr1 = "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
This works fine.
What i am confused on is how i would base my the new list
box on the first one or how i would start the next
statement.
The fields i would like are:-
Learn_id
Provi_id
Lprog_id
Title_la
and they come from a table called [Learning Activity
Dataset].
What i would like to say Select the above fields from
Learning Activity Dataset where Learn_id = me.list20.column
(0), but am unsure how to start after the first list box
statement has finished.
Also i beleive i may have a timing issue as they are both
trying to run at the same time.
Can anyone please help me.
Thanks Everyone
Anthony