K
kbrad28 via AccessMonster.com
I have used a sample listbox search form from another database that will
allow you to type and it automatically start listing records that correspond
to that particular letter or letters.
My problem is this...Once I click my record search button the search form
open as it should, but when I type in the text field nothing happens. WHAT AM
I DOING WRONG??? My code for the text field(search field) and for the list
box. Any help will be greatly appreciated.
Private Sub lstResults_DblClick(Cancel As Integer)
On Error GoTo Err_btnSelect_Click
If Not IsNull(Me![lstResults].Column(0)) Then
lngRecipeIDSelect = Me![lstResults].Column(0)
DoCmd.Close
End If
Exit Sub
Err_btnSelect_Click:
MsgBox Err.Number
Exit Sub
End Sub
______________________________________________
Private Sub txtRecipeName_Change()
Dim txtSearchString As Variant
Dim strSQL As String
txtSearchString = Me![txtRecipeName].Text
strSQL = "SELECT DISTINCTROW tblRecipes.RecipeID, tblRecipes.RecipeName,
FROM tblPeople "
strSQL = strSQL & "WHERE ((tblRecipes.RecipeName) Like '" &
txtSearchString & "*')"
strSQL = strSQL & "ORDER BY tblRecipes.RecipeName"
Me!lstResults.RowSource = strSQL
Me!lstResults.Requery
Me!txtRecipeName.SetFocus
End Sub
Kbrad28
allow you to type and it automatically start listing records that correspond
to that particular letter or letters.
My problem is this...Once I click my record search button the search form
open as it should, but when I type in the text field nothing happens. WHAT AM
I DOING WRONG??? My code for the text field(search field) and for the list
box. Any help will be greatly appreciated.
Private Sub lstResults_DblClick(Cancel As Integer)
On Error GoTo Err_btnSelect_Click
If Not IsNull(Me![lstResults].Column(0)) Then
lngRecipeIDSelect = Me![lstResults].Column(0)
DoCmd.Close
End If
Exit Sub
Err_btnSelect_Click:
MsgBox Err.Number
Exit Sub
End Sub
______________________________________________
Private Sub txtRecipeName_Change()
Dim txtSearchString As Variant
Dim strSQL As String
txtSearchString = Me![txtRecipeName].Text
strSQL = "SELECT DISTINCTROW tblRecipes.RecipeID, tblRecipes.RecipeName,
FROM tblPeople "
strSQL = strSQL & "WHERE ((tblRecipes.RecipeName) Like '" &
txtSearchString & "*')"
strSQL = strSQL & "ORDER BY tblRecipes.RecipeName"
Me!lstResults.RowSource = strSQL
Me!lstResults.Requery
Me!txtRecipeName.SetFocus
End Sub
Kbrad28