Hi,
I want to serach records from the record set i hv created in the following code.This record set
Contains values such as
DD Admin-1
DD Admin-2
D-1
D-2
AD-1
AD-2
I just want to match these fields wid the "combo box value" n as in the example i gave the letters
b4 "-" can be same,so first i hv to extract the fields which hv same letters b4 - n then to find out
the last no.Such as first i found
D-1
D-2
thn i hv to check the max no..in this case it is 2..
So kindly tell me where is the problem in this code as it is giving error on "rs.BOF"
VB Code:
Public Sub Designation() Dim find_value As String Set conn = New clsConnection Set rs = New ADODB.Recordset Dim count_value As Integer Dim results As String Dim index As String Dim no As String conn.clsOpen find_value = "SELECT Designation from System_Users;" rs.Open find_value, conn.cn, adOpenDynamic, adLockBatchOptimistic 'count_value = rs.Fields.Count rs.BOF If Not rs.EOF Then Do While Not rs.EOF 'type_value = rs("Type_Name") ' Form4.cmbID.AddItem type_value results = rs.find("form4.cmbRank.text", adSearchForward) index = InStr(index, "-") no = Left(results, Len(results) - index) MsgBox no, vbOKOnly, "ALERT" rs.MoveNext Loop End If MsgBox results(index), vbOKOnly, "ALERT" conn.clsClose End Sub
Waiting for ur urgent reply
Regards,




Reply With Quote