Limited data in subform

A

AndreasM

I have two tables:
the Baritita with these fields: ([Lesson], [Lesson code])
and the Katastasi with these fields: [StuID], [Lesson], [Degree]

I insert the [Baritita].Lesson in the form as combobox and in a subform the
[Katastasi].StudID as combobox and the [Katastasi].Degree.
I want when i choose a Lesson in the subform i have in combobox
[Katastasi].StudID only the StudID from those students whose has take the
lesson which i have already chooce.

I have already try to use the code from
http://www.mvps.org/access/forms/frm0028.htm
but i have problem to modify it.
('**************** Code Start *************
Private Sub cbxCombo1_AfterUpdate()
Dim strSQL As String
strSQL = "Select " & Me!cbxCombo1
strSQL = strSQL & " from Categories"
Me!cbxCombo2.RowSourceType = "Table/Query"
Me!cbxCombo2.RowSource = strSQL
End Sub
'**************** Code End *************)

Can you help me to modify it or to suggest something other solution?Thanks
 

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