Dear ADezii
i,m totlally new for vb 6.0 and i,m doing a invoice project and i,m facing a issue , can you plz tell me solution
i,m trying to retrive some datas from sql Product table
it contains following fields
ItemNo int,Descrption varchar(20),Supid int,SupName varchar(20),Purprice float,SalPrice float,QtyIn int,QtySold int
i,m trying to retrive some datas from sql Product table
in a Textbox
so
txtItem1.Text txtDes1.Text txtQty1.Text txtRate1.Text
txtItem2.Text txtDes2.Text txtQty2.Text txtRate2.Text
txtItem3.Text txtDes3.Text txtQty3.Text txtRate3.Text
so i write this coding in my txtItem_Clisk event
a = o
n = Val(txtItem1.Text)
adoproduct.Recordset.MoveFirst
Do While Not adoproduct.Recordset.EOF
If adoproduct.Recordset.Fields("ItemNo") = Val(n) Then
txtDescrp1.Text = adoproduct.Recordset.Fields("Descrp")
txtPrice1.Text = adoproduct.Recordset.Fields("Purprice")
txtQty1.Text = adoproduct.Recordset.Fields("QtyIn")
a = 1
End If
adoproduct.Recordset.MoveNext
Loop
If a = 0 Then
MsgBox "Item No Mismatch"
End If
adoproduct.Refresh
and i used the same coding with changed the txtbox name in also other 2 txtbox click event
when i run my form it showed me the error msg
"Run time error 2147217842(80040e4e)
Opreation was canceled
and when i clicked the debug it showed me the
ItemNo,Purprice,QtyIn and the Description column in sql automattically deleted, if i click the 2nd button it running fine
so whats the problem and how can i solve this
plz i need ur help
2 2688
txtItem1.Text txtDes1.Text txtQty1.Text txtRate1.Text
txtItem2.Text txtDes2.Text txtQty2.Text txtRate2.Text
txtItem3.Text txtDes3.Text txtQty3.Text txtRate3.Text
What is this part of the code ?
Thank U debi for ur kind reply i used the same coding for other two txtbox click event and this is my real problem
i,m totlally new for vb 6.0 and i,m doing a invoice project and i,m facing a issue , can you plz tell me solution
i,m trying to retrive some datas from sql (Product table)
it contains following fields
ItemNo varchar(10)
1.N1001
2.C909
3.F600
Descrption varchar(20)
Fan
Chair
Table
Supid int
1001
1009
1010
Purprice float
65.0
47.0
20.0
SalPrice float
75.0
55.0
30.0
QtyIn int
100
300
200
QtySold int
0
0
0
But i need some fileds only like ItemNo,Descrp,Purprice,QtyIn
and my Pinvoice form contains this
.................................................. ..............................................
InvoiceNo-TextBox Date-TextBox
SupId-DataCombo SupName-Textbox
.................................................. ............................................
ItemNo (Label) Descrption (Label) Qty(Lable) Price(Lable) Gross (Lable Qty*Price)
txtItem1.Txt txtDescrp1.Text txtQty1.Text txtRate1.Text txtGross1.Txt
txtItem2.Txt txtDescrp2.Text txtQty2.Text txtRate2.Text txtGross2.Txt
txtItem3.Txt txtDescrp3.Text txtQty3.Text txtRate3.Text txtGross3.Txt
My option is when i type the ItemNo which is in Product table the corresponding Descrp&Purprice&QtyIn should be appear in the other textboxes,once i finish the first row then it,ll happen in another two rows
so in Textbox Click_event i write this codings
dim n as string, dim a as integer
[Adodc control name=adpproduct and i specify the connection and set the recordsource as table name=Product]
a = 0
n = txtItem1.Text
adoproduct.Recordset.MoveFirst
Do While Not adoproduct.Recordset.EOF
If adoproduct.Recordset.Fields("ItemNo") = n Then
txtDescrp1.Text = adoproduct.Recordset.Fields("Descrp")
txtPrice1.Text = adoproduct.Recordset.Fields("Purprice")
txtQty1.Text = adoproduct.Recordset.Fields("QtyIn")
a = 1
End If
adoproduct.Recordset.MoveNext
Loop
If a = 0 Then
MsgBox "Item No Mismatch"
End If
adoproduct.Refresh
and i used the same coding with changed the txtbox name in also other 2 txtbox click event
when i run my form it showed me the error msg
"Run time error 2147217842(80040e4e)
Opreation was canceled
and when i clicked the debug it showed me the only the 2 fields of the Product table
ItemNo's N1001-Purprice 65,QtyIn 100 but Description column in sql automattically deleted from the table, and if i type the C909 in this txtbox with the same error msg it showed me the same value (65,100) if type the ItemNo in 2nd txtItem2.Text it showed me the error
but if i specify the itemNo as C909 in txtItem1.Text it didn't show me other column and directly goes to the EndIf statement and showed me the "Invalid ItemNo"Msgbox
so i take some datas from Product and insert in the new Pinvoice table
so whats the real problem and there is anything wrong in my coding plz tell me how can i solve this problem and instead of textbox how can i use datacombo to retrive the fields and what i should i do to solve this issue
plz i need ur help
Sign in to post your reply or Sign up for a free account.
Similar topics
by: sajithkahawatta |
last post by:
i use asp then i got error
Microsoft OLE DB Provider for ODBC Drivers error '80040e4e'
Operation was canceled.
/dbconn.asp, line 5
the code of dbconn.asp is,
<%
|
by: DUNXALEARE |
last post by:
please help me.
im wrting a program using visual basic 6.0 and using ms access as data base.
when it ry to execute the program. and try to save record in database using adodc the system prompt me...
|
by: hussainiyad |
last post by:
Dear All
i,m totlally new for vb 6.0 and i,m doing a invoice project and i,m facing a issue , can you plz tell me solution
i,m trying to retrive some datas from sql (Product table)
it...
|
by: hussainiyad |
last post by:
Dear All,
I,m doing a invoice project and in it i want to create both salesInvoice & purchase order
my Purchaseinvoice table contains following fields
1.InvoiceNo int primary key
2.Pdate...
|
by: hussainiyad |
last post by:
Dear All,
I,m doing a invoice project and in it i want to create both salesInvoice & purchase order
my Purchaseinvoice table contains following fields
1.InvoiceNo int primary key
2.Pdate...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |