Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21278

displaying just one name out of lot in List View

$
0
0
hi, yeah its me again

now, i have saved data to my table in which fields are CustID, CustName, PrdID,PName
while saving what happens is a Customer buys many Products, what i do there is i add all the products he buys to the flexgrid and then save them to table using bellow code

ST = "select * from custmast"
If rec.State = adStateOpen Then rec.Close
rec.Open ST, DB, adOpenStatic, adLockOptimistic
For i = 1 To fgItems.Rows - 1
rec.AddNew

rec("PN") = fgItems.TextMatrix(i, 1)
rec("PC") = fgItems.TextMatrix(i, 0)

rec!CustID = txtCustID
rec!CustName = txtCustName
rec!Add = txtCustAdd
rec!Ph = txtPh
'rec!PN = txtPN
rec!LN = txtLN
rec!Bal = "0"
Next i
rec.Update

no problem, works great, but what happens is, for every product a new line adds to the table with CustID and CustName

now when i try to display all the customers name in a list view, i get as many same names as the number of products that customer had bought

is there a way to limit it to just name? all i want is the name in the list view without the repetition ......

help plz

Viewing all articles
Browse latest Browse all 21278

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>