Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search: Displaying Record from Access via List.Selected Property

Status
Not open for further replies.

rabbithole

Programmer
May 5, 2000
8
AU
I am trying to conduct a search on an access database table - the records found are then display in a list box.<br>Once a specific record is chosen from the listbox - I am seeking to display same record on a view form.<br><br>Code so far being =<br><br>Sub Search<br><br>&nbsp;&nbsp;&nbsp;&nbsp;letter = txtSearchFind.Text<br>&nbsp;&nbsp;&nbsp;&nbsp;st = &quot;FirstName like '&quot; & letter & &quot;*' &quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;Data1.Refresh<br>&nbsp;&nbsp;&nbsp;&nbsp;Do While True<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Data1.Recordset.FindNext st<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;lstSearchMatches.AddItem_&nbsp;&nbsp;Data1.Recordset.Fields &quot;FirstName&quot;).Value&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If Data1.Recordset.NoMatch = True Then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Exit Do<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;End If<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;Exit Do<br>&nbsp;&nbsp;&nbsp;&nbsp;Loop<br>End Sub<br><br>Sub View_Record<br><br>If frmSearch.lstSearchMatches.Selected(lstSearchMatches.ListIndex) = True Then<br>frmView.Show (lstSearchMatches.List(lstSearchMatches.ListIndex))<br>End Sub<br><br>PROMPT HELP WOULD BE GREATLY APPRECIATED!!!!!!
 
Please see my response to you in your other (identical) post.<br><br>Chip H.<br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top