Hi there,
I am using the following code to allow users to enter partial first names, surnames or student IDs and search for any matches in the database. These matches appear in a listbox and then the user should be able to click on any of those matches that that particular match record should appear.
Does anyone have any ideas as to how to format the bold bits of the code below as this is where the problem lies?
I am using the following code to allow users to enter partial first names, surnames or student IDs and search for any matches in the database. These matches appear in a listbox and then the user should be able to click on any of those matches that that particular match record should appear.
Does anyone have any ideas as to how to format the bold bits of the code below as this is where the problem lies?
Code:
Private Sub QuickSearch_Click()
DoCmd.OpenForm "frm_student", , , "[B][StudentID] = [" & Me![QuickSearch].Column(2) & "]"[/B]
DoCmd.close acForm, "frmStudentSearch", acSaveYes
DoCmd.close acForm, "frm_FrontStudentScreen", acSaveYes
End Sub
Private Sub Search_Change()
Dim vSearchString As String
If Me.Search.text = "" Then
Me.QuickSearch.RowSource = ""
Else
Me.QuickSearch.RowSource = "student"
End If
vSearchString = Search.text
Search2.Value = vSearchString
Me.QuickSearch.Requery
End Sub
Private Sub QuickSearch_AfterUpdate()
DoCmd.Requery
Me.RecordsetClone.FindFirst [B][StudentID] = Me![QuickSearch][/B]
If Not Me.RecordsetClone.NoMatch Then
Me.Bookmark = Me.RecordsetClone.Bookmark
Else
MsgBox "Could not locate [" & Me![QuickSearch].Column(2) & "]"
End If
End Sub