|
-
Nov 21st, 2014, 11:06 AM
#1
Thread Starter
Addicted Member
Help for Filter Combobox (DropDown) in TDBGrid
I need help guys.
I designed Grid to hold data using ComponentOne TdbGrid and in first column I put TdbDropDown to show selection for data.
What I really want, how can I filter combobox data each time user input each letter, the data must filter based on LIKE query, so only what query filtered will be shown on combobox dropdown
\I tried filter but failed, and i think I almost there, only maybe what Event I should put my code
Code:
On Error GoTo BCEErr
Dim TempTxt As String
Select Case ColIndex
Case 0
Select Case bJenis
Case 0
TempTxt = "SELECT fID,fNameGoods FROM tbGoods ORDER BY fNameGoods"
Set BarangRS = dB.Execute(TempTxt)
BarangRS.Filter = "fNameGoods LIKE '" & tgBeli.Columns(0).Text & "'"
Set TDD.DataSource = BarangRS
End Select
End Select
Exit Sub
BCEErr:
MsgBox err.Description, vbCritical
I put inside BeforeColEdit event and ColEdit event, no result as I expected
Please help
-
Nov 21st, 2014, 01:34 PM
#2
Re: Help for Filter Combobox (DropDown) in TDBGrid
The LIKE clause should have at least one wild card. If no wild cards, then it is the same as comparing equality.
Ex: BarangRS.Filter = "fNameGoods LIKE '" & tgBeli.Columns(0).Text & "%'"
-
Nov 21st, 2014, 09:06 PM
#3
Thread Starter
Addicted Member
Re: Help for Filter Combobox (DropDown) in TDBGrid
Thank you for your comment LaVolpe
Is this the great LaVolpe (created button ) ? 
I tried to use wildcard, and the result ok, only if filter input first.
But what happened later, what i need is... each user type letter on keyboard the dropdown combo will be refresh with new filter.
I put inside BeforeColEdit event (only triggered once) and ColEdit (triggered one time only when user press letter)
How can I refresh dropdown each time user press letter on keyboard
Thank you
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|