473,471 Members | 4,095 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Doubt in vb 6.0

31 New Member
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 datetime
3.Supplier Id varchar(10)(This sup id should come from supplier table)
4.SupName(20)
5.ItemNo varchar(10)(This following fields should from Product table)
6.Descrption varchar(20)
7.Purprice float
8.Qty int

my Product table contains followings 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


so the invoice form i created like this

Invoice No (TextBox) Pdate(TextBox)

SupId (DataCombo) SupName(TextBox)
'''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''''''
ItemNo Descrp Price Qty Gross

txtItemNo1.text txtdes1.text txtprice1.text txtqty1.text txtgross1.text

txtItemNo2.text txtdes2.text txtprice2.text txtqty2.text txtgross2.text

txtItemNo3.text txtdes3.text txtprice3.text txtqty3.text txtgross3.text


This is my form and i need to retrive the SupName from supplier table when i choose the datacombo SupId(i already binded) and i when i type and click the ItemNo in txtItemNo1.Text then i want to come all the description,Qty,PurPrice to that corresponding itemno(i have 10 itemno with descrp,qty,price in the table)
from the Product table, so when i type the ItemNo in txtItemNo2.text the another
ItemNo will come it same for all txtbox

so i write the following coding in txtItemNo1.Click event
dim a as integer, dim n as string
a = 0
n = Val(txtItem1.Text)
adoproduct.Recordset.MoveFirst
Do While Not adoproduct.Recordset.EOF
'Do While Not EOF
'If adosupplier.Recordset.Fields("SupId") = Val(n) Then
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

it,s not working and showed me the error msg

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 ItemNoC909 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
Apr 15 '08 #1
0 1028

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Guilherme Pinto | last post by:
Hello. I am reading the book written by Bjarne Stroustrup called " The C++ Programming Language - Special Edition" and had a doubt which a think is really important to distinguish between the...
138
by: ambika | last post by:
Hello, Am not very good with pointers in C,but I have a small doubt about the way these pointers work.. We all know that in an array say x,x is gonna point to the first element in that...
4
by: dam_fool_2003 | last post by:
I am just a beginner in tree data – struct. I have this little doubt. Left node ‘weights' lesser than the right one. I have seen, so far it is algorithm implementations. But why not vice-versa that...
20
by: maadhuu | last post by:
firstly, i am thankful to all those who answered the 1st set of doubts. And i am not yet enlightened to that extent , coz ' i keep getting doubts. is the following defined in the language ?? int...
3
by: SMG | last post by:
Hi All, It might be a silly doubt, but it is a doubt.... I am using form authentication for my website, now my web application is gonna be deployed on two web servers with Load Balancing...
77
by: muttaa | last post by:
Hello all, My doubt is going to be so primitive that i ask you all to forgive me beforehand.... Here's the code snippet: int main() { int x=5;
11
by: Bob Nelson | last post by:
I don't remember seeing the term ``doubt'' used much in c.l.c. back in the 90's. When did this word become nearly synonymous with ``question'' or ``query'' and does it have static duration?
122
by: ivan | last post by:
hi all, if I have: if(A && B || C) which operation gets executed first? If I remeber well should be &&, am I correct? thanks
5
by: Paulo | last post by:
Hi, I have a RadioButtonList and I need to do some verifications on a "OnChange" event on client... because on classic asp/html I just add a "onChange" event on <input type="radio" onChange="">,...
0
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...
0
marktang
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,...
0
jinu1996
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.