This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
vba:flexiblerfilter [15.01.2016 11:07:07] yaslaw created |
vba:flexiblerfilter [29.01.2019 08:36:08] (current) yaslaw [Mittels Array] |
||
---|---|---|---|
Line 6: | Line 6: | ||
===== Ausgangslage ===== | ===== Ausgangslage ===== | ||
Als Beispiel nehmen wir ein Formular mit 3 Filter. | Als Beispiel nehmen wir ein Formular mit 3 Filter. | ||
- | 1) Ein Textfeld für die Adresse: | + | |
- | Formularfeld: txtAddress | + | __1) Ein Textfeld für die Adresse:__ |
- | Tabellenfeld: address | + | \\ //Formularfeld: txtAddress// |
- | DataType: String | + | \\ //Tabellenfeld: address// |
- | 2) Eien Combobox. Inkl. einem Eintrag "-1" und der Beschriftung "ALL" | + | \\ //DataType: String// |
- | Formularfeld: cbxAddressType | + | |
- | Tabellenfeld: addressTypeId | + | __2) Eine Combobox. Inkl. einem Eintrag "-1" und der Beschriftung "ALL"__ |
- | DataType: Long | + | \\ //Formularfeld: cbxAddressType// |
- | 3) 2 Datumsfelder für ein Between | + | \\ //Tabellenfeld: addressTypeId// |
- | Formularfeld: dtFrom, dtTo | + | \\ //DataType: Long// |
- | Tabellenfeld: createDate | + | |
- | DataType: Date | + | __3) 2 Datumsfelder für ein Between__ |
+ | \\ //Formularfeld: dtFrom, dtTo// | ||
+ | \\ //Tabellenfeld: createDate// | ||
+ | \\ //DataType: Date// | ||
===== Der Klassiker ===== | ===== Der Klassiker ===== | ||
Line 58: | Line 61: | ||
If NZ(me!cbxAddressType, -1) > -1 Then | If NZ(me!cbxAddressType, -1) > -1 Then | ||
i = i + 1: Redim Preserve flt(i) | i = i + 1: Redim Preserve flt(i) | ||
- | v = "addressTypeId = " & me!cbxAddressType | + | flt(i) = "addressTypeId = " & me!cbxAddressType |
End If | End If | ||
If Not IsNull(Me!dtFrom) And Not IsNull(Me.dtTo) Then | If Not IsNull(Me!dtFrom) And Not IsNull(Me.dtTo) Then | ||
i = i + 1: Redim Preserve flt(i) | i = i + 1: Redim Preserve flt(i) | ||
- | v = ftl & "createDate BETWEEN " & format(me!dtFrom, "\#MM-DD-YYYY\#") & " AND " & format(me!dtTo, "\#MM-DD-YYYY\#") | + | flt(i) = ftl & "createDate BETWEEN " & format(me!dtFrom, "\#MM-DD-YYYY\#") & " AND " & format(me!dtTo, "\#MM-DD-YYYY\#") |
End If | End If | ||