Hi,
I have one problem that I need to solve. In the last post, according to you all solution, I can filter on number base on user input. And the even that I use for
dropdown control is :
In form, for eco_code dropdown list, column count is 2. eco_code control bound column is 1, and column count=2 will give eco_description control.
When user input on eco_code, the other eco_description will disappear for a while, until user click to select from list, then the other eco_description text will
show up again.
For user input, this is not very convenient cuz could make feel confuse.
Could you tell how can I change this?
Best regards,
Sophanna
I have one problem that I need to solve. In the last post, according to you all solution, I can filter on number base on user input. And the even that I use for
dropdown control is :
Code:
Private Sub eco_code_Change()
Dim varKey As Variant
On Error GoTo ErrorHandler
varKey = Me.eco_code.Text
strsql = "select code,description FROM expenditure_eco_classification WHERE Cstr(expenditure_eco_classification.code) LIKE '" & varKey & "*' ORDER BY
expenditure_eco_classification.code"
' To let cursor on other component to refresh rowsource everytime there is something change in eco_code combo box
Me.txtHidden.SetFocus
Me.eco_code.RowSource = strsql
Me.eco_code.Requery
Me.eco_code.SetFocus
Me.eco_code.Dropdown
Exit Sub
ErrorHandler:
' Display error information.
Select Case Err.Number
Case Is = 2110
Resume Next
Case Is = 2118
Resume Next
Case Else
MsgBox "Error number " & Err.Number & ": " & Err.Description
' Resume with statement following occurrence of error.
Resume Next
End Select
End Sub
Code:
Private Sub eco_code_GotFocus()
'Automatic dropdown list when the field is being selected
Me.eco_code.Dropdown
End Sub
Code:
Private Sub eco_code_LostFocus()
' This code purpose is after Change() function, then in the next record rowsource will be limit to Select statement with condition.
' So we need to define default rowsource with full list to this control back
strsql = "select code,description FROM expenditure_eco_classification ORDER BY expenditure_eco_classification.code"
Me.eco_code.RowSource = strsql
End Sub
When user input on eco_code, the other eco_description will disappear for a while, until user click to select from list, then the other eco_description text will
show up again.
For user input, this is not very convenient cuz could make feel confuse.
Could you tell how can I change this?
Best regards,
Sophanna
Comment