I've managed to incorporate this wonderful dynamic search engine into my database (Link below). However I would like to be able to be able to click on the search results to open a form that contains detailed specs for the item. I already have the form I want to open created I just want to be able to open the item from the dynamic search results.
FYI: The Dynamic search "PKGMaterialQuery" results are populated off a list "PKGMaterial" and I want to double click to open a bound form "PKGMaterialForm" which would be populated off the same list "PKGMaterial"
I will try and upload a sample database but i need to clean up some data first.
Here is the link to the code I'm using (Wont let me post links so filll in www dot below)
access-programmers.co.uk/forums/showthread.php?t=188663
My Exact Code
"Private Sub SearchFor1_Change()
'Create a string (text) variable
Dim vSearchString As String
'Populate the string variable with the text entered in the Text Box SearchFor
vSearchString = SearchFor1.Text
'Pass the value contained in the string variable to the hidden text box SrchText,
'that is used as the sear4ch criteria for the Query QRY_SearchAll
SrchText1.Value = vSearchString
'Requery the List Box to show the latest results for the text entered in Text Box SearchFor
Me.SearchResults.Requery
'Tests for a trailing space and exits the sub routine at this point
'so as to preserve the trailing space, which would be lost if focus was shifted from Text Box SearchFor
If Len(Me.SrchText1) <> 0 And InStr(Len(SrchText1), SrchText1, " ", vbTextCompare) Then
Exit Sub
End If
'Set the focus on the first item in the list box
Me.SearchResults = Me.SearchResults.ItemData(1)
Me.SearchResults.SetFocus
'Requery the form to refresh the content of any unbound text box that might be feeding off the record source of the List Box
DoCmd.Requery
'Returns the cursor to the the end of the text in Text Box SearchFor
Me.SearchFor1.SetFocus
If Not IsNull(Len(Me.SearchFor1)) Then
Me.SearchFor1.SelStart = Len(Me.SearchFor1)
End If
End Sub"
Any help would be greatly appreciated!!!!
FYI: The Dynamic search "PKGMaterialQuery" results are populated off a list "PKGMaterial" and I want to double click to open a bound form "PKGMaterialForm" which would be populated off the same list "PKGMaterial"
I will try and upload a sample database but i need to clean up some data first.
Here is the link to the code I'm using (Wont let me post links so filll in www dot below)
access-programmers.co.uk/forums/showthread.php?t=188663
My Exact Code
"Private Sub SearchFor1_Change()
'Create a string (text) variable
Dim vSearchString As String
'Populate the string variable with the text entered in the Text Box SearchFor
vSearchString = SearchFor1.Text
'Pass the value contained in the string variable to the hidden text box SrchText,
'that is used as the sear4ch criteria for the Query QRY_SearchAll
SrchText1.Value = vSearchString
'Requery the List Box to show the latest results for the text entered in Text Box SearchFor
Me.SearchResults.Requery
'Tests for a trailing space and exits the sub routine at this point
'so as to preserve the trailing space, which would be lost if focus was shifted from Text Box SearchFor
If Len(Me.SrchText1) <> 0 And InStr(Len(SrchText1), SrchText1, " ", vbTextCompare) Then
Exit Sub
End If
'Set the focus on the first item in the list box
Me.SearchResults = Me.SearchResults.ItemData(1)
Me.SearchResults.SetFocus
'Requery the form to refresh the content of any unbound text box that might be feeding off the record source of the List Box
DoCmd.Requery
'Returns the cursor to the the end of the text in Text Box SearchFor
Me.SearchFor1.SetFocus
If Not IsNull(Len(Me.SearchFor1)) Then
Me.SearchFor1.SelStart = Len(Me.SearchFor1)
End If
End Sub"
Any help would be greatly appreciated!!!!