thetambarineman
Technical User
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
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