Hi Everyone,
I am trying to rework some code within a Db that I found during my searches at https://access-programmers.co.uk/for...d.php?t=188663
I have been looking at the code behind and although I am not the brightest, I think I understand most of what to do to with it to make it suit my needs.
My issue is that i am stuck at one part, I just can't seem to figure out how the code works with the radio buttons named (Option39,41 etc etc) labelled cork , stelvin on the main form, can anyone explain to me the principle of how these work on change event, please see the sample DB attached for the info.
The form has a textbox the has an onchange event with this code :
Code:
Private Sub SearchFor_Change()
'Create a string (text) variable
Dim vSearchString As String
'Populate the string variable with the text entered in the Text Box SearchFor
vSearchString = SearchFor.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
SrchText.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.SrchText) <> 0 And InStr(Len(SrchText), SrchText, " ", 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.SearchFor.SetFocus
If Not IsNull(Len(Me.SearchFor)) Then
Me.SearchFor.SelStart = Len(Me.SearchFor)
End If
End Sub
Thanks in advance to anyone who can explain in simple terms