Drew Jensen wrote:
anyway - there are more then a few examples of this on the forums...I'll get back tonight regarding my little dev3.1 example....arrrgh again...

my bad!

See the attached file (You must have a DEV310 build for this )

Open the form and notice that when you select from the listbox 'Group' it changes the available items in the listbox 'FK'.

For those that don't have the development build the example macro is:

sub onGroupCBXChange( oEv as object )
        dim sSelectedItem
        dim grpCombo
        dim fkCombo
        dim aryStrings(0) as string
        dim iGroup_id
        
        sSelectedItem = oEv.Source.SelectedItem
        grpCombo = oEv.Source.Model
        fkCombo = grpCombo.Parent.getByName("cmboxFK" )
        if sSelectedItem = "Color" then
                iGroup_id = 0
        else
                iGroup_id = 1
        end if
        aryStrings(0) = "SELECT ""Val"", ""id"" FROM ""Table2"" WHERE ""group_id"" = 
" + iGroup_id
        fkCombo.ListSource = aryStrings
        fkCombo.refresh
end sub


This sub procedure is called from the ItemChanged event on the group listbox.

HTH

Drew

Attachment: combo_chg.odb
Description: application/vnd.oasis.opendocument.database

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to