Respected Sir,
I am making a sofware in vb 6.0. I am making a Filter Form.
in this software. problem is when i am enter date range in textbox when i am enter date and click on ok button then it give error 3021 either bof or eof is true or current record is deleted.
but when i am enter any reciept number in range of a textbox it should not give any error and show the result.
code:---
Public Sub getconnection()
Set getcon = New ADODB.Connection
getcon.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\DAK.mdb"
End Sub
Public Sub getrecord()
getconnection
getcon.Open
Dim fatchrecord
Set rsrecord = New ADODB.Recordset
If Option6.Value = True Then
' If Text3.Text = "" Or Text4.Text = "" Then
' MsgBox ("Please Enter Date")
' Exit Sub
' Else
fatchrecord = "SELECT DAK.RecptNo, DAK.RecptDt, DAK.Type, DAK.FromWhom, DAK.Name, DAK.Address, DAK.AddressTo, DAK.Sender, DAK.SenderNo, DAK.SenderDt, DAK.Subject, DAK.BriefCon, DAK.MarkTo, DAK.MarkDt, DAK.Remarks, DAK.Action, DAK.tdate, Type.Type_desc, From.From_Desc, From.From_Desig, From.From_Add, MarkTo.Mark_desc, Action.Action FROM (((DAK INNER JOIN [Action] ON DAK.Action = Action.ActionId) INNER JOIN MarkTo ON DAK.MarkTo = MarkTo.Mark_id) INNER JOIN Type ON DAK.Type = Type.Type_id) INNER JOIN [From] ON DAK.FromWhom = From.From_id Where Dak.RecptDt>=" & CDate(Text3.Text) & " and Dak.RecptDt<=" & CDate(Text4.Text) & ""
' End If
End If
If Option5.Value = True Then
fatchrecord = "SELECT DAK.RecptNo, DAK.RecptDt, DAK.Type, DAK.FromWhom, DAK.Name, DAK.Address, DAK.AddressTo, DAK.Sender, DAK.SenderNo, DAK.SenderDt, DAK.Subject, DAK.BriefCon, DAK.MarkTo, DAK.MarkDt, DAK.Remarks, DAK.Action, DAK.tdate, Type.Type_desc, From.From_Desc, From.From_Desig, From.From_Add, MarkTo.Mark_desc, Action.Action FROM (((DAK INNER JOIN [Action] ON DAK.Action = Action.ActionId) INNER JOIN MarkTo ON DAK.MarkTo = MarkTo.Mark_id) INNER JOIN Type ON DAK.Type = Type.Type_id) INNER JOIN [From] ON DAK.FromWhom = From.From_id Where Dak.RecptNo>=" & Val(Text1.Text) & " and Dak.RecptNo<=" & Val(Text2.Text) & ""
End If
"select * from dak"
Set rsrecord.ActiveConnection = getcon
rsrecord.Open fatchrecord, getcon, adOpenDynamic, adLockOptimistic
' On Error Resume Next
rsrecord.MoveLast
------------------- give error when i am enter date in search box
but when i am enter number then is give no error
Please Give the me soultion fast becuase it is urgent becuase this software is running after 2 day in a company.
Please Plz give me solution