Code: Select all
Sub FiltraCiclePerFamilia(listbox As Object, familia As String)
Dim lbSQL(0) As String
lbSQL(0) = "SELECT nom, codi FROM cicle"
'Filter only if an option had been picked on the first listbox,
'otherwise show up all possibilities
If familia <> "" Then
lbSQL(0) = lbSQL(0) & " WHERE familia = '" & familia & "'"
End If
MsgBox familia 'For debugging purposes
'Update listbox contents
listbox.ListSource = lbSQL
listbox.refresh()
End Sub
'Called on first listbox change
Sub ActualitzaCicles(oEv As Object)
Dim form As Object
form = oEv.Source.Model.Parent
Dim lbxCicle As Object
Dim familia As String
lbxCicle = form.getbyname("txtcicle")
familia = form.getbyname("txtfamilia").BoundField.getString()
MsgBox form.getbyname("txtfamilia").CurrentValue 'For debugging purposes
FiltraCiclePerFamilia(lbxCicle, familia)
End Sub
Is this a bug or there is something that I must do manually to syncronize the BoundField?
I'm using OOo 3.0.0 from Fedora 10 repository and working on a remote PostgreSQL database.
Thank you in advance for your attention.