473,467 Members | 1,570 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Datalist with datagrid in vb .6.6

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 1116

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

Similar topics

2
by: acko bogicevic | last post by:
Hi I have a problem something like this I want to show in datalist customers but below to show orders for customer. I created datalist control and inside it i have to label for CustomerID and...
1
by: wsyeager36 | last post by:
I have a datagrid inside a datalist. The datalist shows parent info and the datagrid shows the child info for that parent. There is a checkbox on each row of the child datagrid. Also inside the...
1
by: bill yeager | last post by:
I have a datagrid control within a datalist control. When I try and do a "Find" on the control, the object comes back with nothing and then my pgm crashes. I am 100% sure that my datagird inside...
8
by: Nevyn Twyll | last post by:
I have a multi-level datalist setup: DataList1 DataList2 MyGrid I have columns explicitly defined for the grid in the html. Sometimes, On the initial Load() of the Page, I want to add extra...
1
by: DotNetJunkies User | last post by:
Hi, I was wondering if it is possible to load datagrid into datalist programatically using ITemplate interface with the following structure and place intp placeholder control. PlaceHolder -...
3
by: CVerma | last post by:
Hi, I have an embedded datagrid within a datalist. I am not able to perfrom paging in the datagrid. Any ideas? Here is my code: Here is my Simplegrid.cs file: using System; using...
6
by: tshad | last post by:
I need to get to a status label I have on my footer section of my datalist. There is no event happening that would go to the footer. I am just doing some processing and want to update the label...
2
by: Eduardo Rosa | last post by:
Hello people, I'm using DataList to show some info from db (sqlserver), my question is about how make a button that call a function to do something using info from a line of the DataList. I...
1
by: Brock | last post by:
First note that I am using Framework 1.1. I have an .aspx page that is displaying a list of employees, but only the Employee Number, First Name, Last Name, and Title. It is working great. I...
1
by: Brock | last post by:
Thanks in advance... (you can see a screenshot of what my form looks like currently at http://www.juggernautical.com/DataGrid.jpg - the Datalist is super-imposed in 'design view' but the DataGrid...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
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 ...

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.