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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Searching code problem...

Status
Not open for further replies.

thetambarineman

Technical User
Feb 29, 2000
63
GB
Hello all,

having a problem with some of my code- i have a module which is called from a separate search form - call it frmsearch.. the database its searching is on another form- call it frmemployer... below is the how the procedure is called:

systemsearch frmemployer.dbemployer, "employer_name", txtsearchemp, Listemp
frmemployer.show

the following is the module code:

Public Sub systemsearch(sysfield As String, syssearchdata As String, syssearchlist As ListBox)

recsfound = 0
frmemployer.dbemployer.Recordset.MoveFirst

Do Until frmemployer.dbemployer.Recordset.EOF
If InStr(UCase(frmemployer.dbemployer.Recordset(sysfield)), UCase(syssearchdata)) Then
recsfound = recsfound + 1
syssearchlist.AddItem frmemployer.dbemployer.Recordset(sysfield)

End If
frmemployer.dbemployer.Recordset.MoveNext
Loop

If recsfound = 0 Then MsgBox "No Records Found, please refine your search.."

End Sub

This will just not work for some reason - when i go to the employer form its no longer pointing at the correct record -its pointing its moved to the first record in the employer database...

Can anyone help?? this problem is really holding me up!!!

Thanks in advance...
Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top