Access-o-Mania

Access-Forum (Deutsch/German) => Access Programmierung => Thema gestartet von: tobsn121 am August 10, 2015, 14:56:27

Titel: Bedingte ComboBox
Beitrag von: tobsn121 am August 10, 2015, 14:56:27
Hallo Zusammen,

ich möchte eine bedingte ComboBox erstellen, diese soll bei Auswahl eines Wertes in einer vorgeschalteten ComboBox nur noch eine daran gekoppelte Auswahl anzeigen.

Leider funktioniert mein Code nicht.. es erscheint immer ein Box mit "Enter Parameter Value"

Danke für eure Hilfe!

Hier mein Code:

Private Sub cboIndustry_AfterUpdate()

    Me.cboSub_Industry.RowSource = "SELECT SubInd" & _
                                    " FROM tblIndustry2" & _
                                    " WHERE Ind = " & Me.cboIndustry
                                   
                                   
End Sub
Titel: Re: Bedingte ComboBox
Beitrag von: MzKlMu am August 10, 2015, 15:17:47
Hallo,
welcher Datentyp ist Ind  ?
Titel: Re: Bedingte ComboBox
Beitrag von: tobsn121 am August 10, 2015, 15:30:46
String
Titel: Re: Bedingte ComboBox
Beitrag von: MzKlMu am August 10, 2015, 15:31:41
    Me.cboSub_Industry.RowSource = "SELECT SubInd" & _
                                    " FROM tblIndustry2" & _
                                    " WHERE Ind = "' & Me.cboIndustry &"'"

Bei String sind Kochkomma (') zu verwenden.
Titel: Re: Bedingte ComboBox
Beitrag von: tobsn121 am August 10, 2015, 16:05:31
Besten Dank!