Runtime Error 3001 – Arguments are of the wrong type or out of acceptable range or are in conflict with one another

20 pts.
Tags:
Error 3001
Runtime Error 3001 - Arguments are of the Wrong Type or out of acceptable range or are in conflict with one another
Runtime Errors
Visual Basic 6
Dear Sir, Thanks for your answer for my earlier questing. It solved my problem I am using VB6 as front end and Access as back end. I'm editing my table for particular field. I am editing rate of one item in RMmaster file. It's doing it, but I want to edit rate of same field which is in another file. I am getting above error. My code is as under:
:- If Rs1.State = adStateOpen Then Rs1.Close Rs1.Open "select * from bill_details where prod_sno=" & Val(LblSr.Caption), Cn, adOpenDynamic, adLockOptimistic If Rs1.RecordCount > 0 Then Dim OldRt As Integer Dim bILL As Integer Rs1.MoveFirst For i = 1 To Rs1.RecordCount OldRt = Rs1("amt") Rs1("rate") = Val(TxtRate.Text) Rs1("amt") = Rs1("rate") * Rs1("qty") / 100 Rs1.MoveNext If Rs2.State = adStateOpen Then Rs2.Close Rs2.Open "Select * from bill where invoice_no" = Rs1("Bill_Sno"), Cn, adOpenDynamic, adLockOptimistic >>>> on this line i am getting error >>>> Rs2("total_amt") = Rs2("total_amt") - OldRt + Rs1("amt") Next End
Please help if you can. Regards and thanks in advance.

Answer Wiki

Thanks. We'll let you know when a new response is added.

Try replacing that line with this:

Rs2.Open "Select * from bill where invoice_no<b>=" &</b> Rs1("Bill_Sno"), Cn, adOpenDynamic, adLockOptimistic

Discuss This Question: 3  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Kirithigan
    Hi Friends, I am using VB6 as front end and Access as back end. i done a application for data entering with date. after this i want to check the schedule of the data means by using the schedule by selecting from to date (dtpickr) it will show the data report. but now its getting error. i dont know where did i went wrong Arguments are of the Wrong Type or out of acceptable range or are in conflict with one another Private Sub Command1_Click() Dim i As Integer Dim j As Integer Dim k As Integer Call dbconn If rs.State = 1 Then rs.Close query = "Select tagno,description,nextdate from Table2 where nextdate between # " & aod.Value & "# and # " & aodto.Value & "#" rs.Open query, cn, 3, 3 With DataReport1 j = 0 k = 0 With .Sections("Section1").Controls For i = 1 To .Count If TypeOf .Item(i) Is RptTextBox Then .Item(i).DataMember = "" .Item(i).DataField = rs.Fields(j).Name j = j + 1 End If Next i End With End With Set DataReport1.DataSource = rs.DataSource DataReport1.Show DataReport1.Refresh==> HERE AM GETTING ERROR DataReport1.SetFocus schedule.WindowState = 1 Call clearfield(Me) End Sub
    10 pointsBadges:
    report
  • carlosdl
    Hi Kirithigan. Maybe the format of aod or aodto is incorrect. Try displaying the query before refreshing the report, so you can see the exact query that is being sent to the database. Then, try running the same query on Acess to see if it runs without errors.
    69,835 pointsBadges:
    report
  • Nidhijoshi
    declare connection object as public in your module to solve the problem for further discussion write your questions at this address http://softwaredeveloper-nidhi.blogspot.com/2011/06/vb60.html
    10 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following