G
Guest
I have a working stored proc that returns alpha list properly when given
first character. I want to use it as row source for a combo box. This code
doesn't return anything. Where am I off?
Private Sub txt_FirstLetter_KeyUp(KeyCode As Integer, Shift As Integer)
Dim str_KeyStroke As String
str_KeyStroke = UCase$(Chr$(KeyCode))
If (str_KeyStroke >= "A") And (str_KeyStroke <= "Z") Then
Me.cbo_SubsetNames.RowSource = _
"EXEC sp_cbo_source_EmployeeName '" & str_KeyStroke & "'"
Me.cbo_SubsetNames.SetFocus
SendKeys str_KeyStroke ' put the char into the combo
Me.cbo_SubsetNames.Dropdown
End If
End Sub
The sp takes care of the "like X%"
Those are apostrophes being wrapped around str_KeyStroke.
The sp arg is @FirstKey varchar(1)
and works when the sp is executed from the Access Query page.
first character. I want to use it as row source for a combo box. This code
doesn't return anything. Where am I off?
Private Sub txt_FirstLetter_KeyUp(KeyCode As Integer, Shift As Integer)
Dim str_KeyStroke As String
str_KeyStroke = UCase$(Chr$(KeyCode))
If (str_KeyStroke >= "A") And (str_KeyStroke <= "Z") Then
Me.cbo_SubsetNames.RowSource = _
"EXEC sp_cbo_source_EmployeeName '" & str_KeyStroke & "'"
Me.cbo_SubsetNames.SetFocus
SendKeys str_KeyStroke ' put the char into the combo
Me.cbo_SubsetNames.Dropdown
End If
End Sub
The sp takes care of the "like X%"
Those are apostrophes being wrapped around str_KeyStroke.
The sp arg is @FirstKey varchar(1)
and works when the sp is executed from the Access Query page.