Can someone please check my vb script

kirtney

Registered User.
Local time
Today, 11:20
Joined
May 26, 2011
Messages
14
I am trying to link 2 combo boxes. One called ClassID (Combo0) and one called StudentName (Combo2). I followed the steps outline for the VB scripting for it and I am getting the ClassID to be a drop down field but not the StudentName. Please advise. This is the VB script I used

Private Sub Combo0_AfterUpdate()
'Update the row source of the Combo2 combo box
'When the user makes a selection in the Combo0
'combo box
Me.Combo2.RowSource = " Select StudentName FROM " & _
" Student WHERE Student.ClassID = " & Me.Combo0.Value & " " & _
" ORDER BY StudentName"

Me.Combo2 = Me.Combo2.ItemData

End Sub



Any help would be greatly appreciated
 
Have you tried dropping the itemdata line?
 
Also worth checking what the bound column number is in combo0. The Value property, I think, returns that. The other way to do this would be to subsitute combo0.column(x) for .value, where x is the classID's column number, starting from 0.
 

Users who are viewing this thread

Back
Top Bottom