New to access trying to create the following list box see attached pic
i dont know how to link the search criteria to the to the List box
And on the bottom you will notice option buttons so if user wants to
search by account # user selects option button called Account# and so forth.
You will notice a command button called find patient. Once command button is pressed opens the form called Search Patient
when user selects patient user clicks on go to patient
this part works find
I placed everything under the detail section of the form
I have the following code
Private Sub List12_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[Account #] = " & Str(Nz(Me![List12], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
Private Sub Go_To_Record_Click()
On Error GoTo Err_Go_To_Record_Click
Dim stDocName As String
Dim stLinkCriteria As String
Here is a search that will display findings into your listbox If you need code for the listbox as well post again and Ill get that on here to!
vb code_____________________________________
Private Sub txtSearch_Change() <---you can change to a cmdclick if needed
If txtSearch.Text = vbNullString Then
sSQL = "SELECT * from EMPDATA " <--This is my table set yours,
Set rs = db.OpenRecordset(sSQL)
Else
Set rs = db.OpenRecordset("SELECT * FROM EMPDATA WHERE ID LIKE '" & txtSearch.Text & "*'") <--Change to your table and change ID to your record
End If
list <-- Will display the found record in the listbox
End Sub
Last edited by Quizton; Dec 26th, 2005 at 01:37 AM.