thetambarineman
Technical User
Hello all,
OK-I should probably start off by explaining the situation- basically i have several forms. - One search form, and an employer form are the ones that im concerned with at the minute- Previously i had code that searched a the database - ive lost it now!! it wasnt working properly though and a guy from tek-tips helped me out - thanx Ruairi!! the following is the code which he supplied me with-
Sub systemsearch(sysdata As Data, sysfield As String, syssearchdata As String, syssearchlist As ListBox)
recsfound = 0
sysdata.Recordset.MoveFirst
Do Until sysdata.Recordset.EOF
If InStr(UCase(sysdata.Recordset(sysfield)), UCase(syssearchdata)) Then
recsfound = recsfound + 1
syssearchlist.AddItem sysdata.Recordset(sysfield)
End If
sysdata.Recordset.MoveNext
Loop
If recsfound = 0 Then MsgBox "No records found, please refine your search.."
End Sub
The search is fine- however - when i go to say the employer form- the record is not pointed at the correct record!! - in fact theres nothing in the txt boxes..
Can anyone suggest a way (other than sql) of remedying this situation...
Excuse the spelling..!!
Thanks in advance...
Paul...
OK-I should probably start off by explaining the situation- basically i have several forms. - One search form, and an employer form are the ones that im concerned with at the minute- Previously i had code that searched a the database - ive lost it now!! it wasnt working properly though and a guy from tek-tips helped me out - thanx Ruairi!! the following is the code which he supplied me with-
Sub systemsearch(sysdata As Data, sysfield As String, syssearchdata As String, syssearchlist As ListBox)
recsfound = 0
sysdata.Recordset.MoveFirst
Do Until sysdata.Recordset.EOF
If InStr(UCase(sysdata.Recordset(sysfield)), UCase(syssearchdata)) Then
recsfound = recsfound + 1
syssearchlist.AddItem sysdata.Recordset(sysfield)
End If
sysdata.Recordset.MoveNext
Loop
If recsfound = 0 Then MsgBox "No records found, please refine your search.."
End Sub
The search is fine- however - when i go to say the employer form- the record is not pointed at the correct record!! - in fact theres nothing in the txt boxes..
Can anyone suggest a way (other than sql) of remedying this situation...
Excuse the spelling..!!
Thanks in advance...
Paul...