I have a select query that returns a list of names to a combobox. I need to limit the list to the first letter entered.
Within the query it would be "like 'F' & '*'". without the outer quotes. This works but is obviously not very practical.
I have a function in the criteria to do this but when I enter >myFuntion access inserts the table and field as
![field], before the function call resulting in a type mismatch. How can I dynamically change the criteria?
For some reason the "table" inside [] will not appear in the text!!
My function code below.
sKey is a public string variable.
Should the function, which is in a module, be Public?
The combobox code below
Is the "call" necessary with no parameters passed and does it make any difference?
Within the query it would be "like 'F' & '*'". without the outer quotes. This works but is obviously not very practical.
I have a function in the criteria to do this but when I enter >myFuntion access inserts the table and field as
![field], before the function call resulting in a type mismatch. How can I dynamically change the criteria?
For some reason the "table" inside [] will not appear in the text!!
My function code below.
Code:
Function getKey()
getKey = "'like' & sKey & '*'"
End Function
sKey is a public string variable.
Should the function, which is in a module, be Public?
The combobox code below
Code:
Private Sub CboGetName_Keypress(KeyAscii As Integer)
sKey = UCase(Chr(KeyAscii))
Call getKey()
Me.CboGetName.Dropdown
End Sub
Is the "call" necessary with no parameters passed and does it make any difference?
Last edited: