Welcome to Dream.In.Code
Getting VB Help is Easy!

Join 136,574 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 1,890 people online right now. Registration is fast and FREE... Join Now!




Searching record using common field in same table

 
Reply to this topicStart new topic

Searching record using common field in same table

penzzap
21 Apr, 2008 - 09:50 PM
Post #1

New D.I.C Head
*

Joined: 21 Apr, 2008
Posts: 1

I have a small project using only one form with textboxes and list view. i used textboxes to reflect my records from SQL database I have ADD, EDIT, DELETE, and UPDATE buttons my codes are working except displaying in the listview the exact output. Here are some fields in my PAYMENT table. strReceiptNo, DatePaid, strLastName, strFirstName, strMidName, strPayFor, curAmount. I wnat to display the strPayFor and curAmount in the listview depending on the strReceipt in the txtReceiptNo.text (a textbox control in my form). There are more than 1 strPayFor and curAmount in 1 strReceiptNo. in my code all are displayed.

here is my code...

Public Sub disReceipt()
If (txtReceiptNo.Text) = myOtherPay.rsOthers.Fields(0).Value Then
ListView1.ListItems.Add , , txtReceiptNo.Text
ListView1.ListItems(ListView1.ListItems.count).SubItems(1) = Trim(txtReceiptNo.Text)
ListView1.ListItems(ListView1.ListItems.count).SubItems(1) = Trim(cboDesc.Text)
ListView1.ListItems(ListView1.ListItems.count).SubItems(2) = Val(txtAmtPaid)
End If
End Sub



Thanks.

This post has been edited by penzzap: 21 Apr, 2008 - 09:53 PM
User is offlineProfile CardPM
+Quote Post

kenji
RE: Searching Record Using Common Field In Same Table
14 May, 2008 - 03:28 PM
Post #2

New D.I.C Head
*

Joined: 2 Sep, 2007
Posts: 29


My Contributions
When posting code please use:

[code] code here [\code]
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/3/08 12:04AM

Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month