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

[RESOLVED] how to select 2 values from different tables and display it in a listview Via Sql

$
0
0
i added a combobox named CmbTreat and it pulls values from a table called PriceList
my question is how do i add the customer name and his phone number from Customers table and the treatment i gave his from another table Called [Event]?
e.x "salsa" is the name of the customer [FullName] this is his phone number "999093039" [Cellular]
and the treatment he did called HairCut [Location] from Event Table
i hope i am not misunderstood.
i want pull the customer name and phone number from 1 table and pull his treatment from another
is this possible?
this are the values that i need to display in the combobox
Code:

table name Customers
Customer name - FullName
Customer phone - Cellular

Code:

table name Event
Customer Treatment - Location

Btw this is how i add [filter] By Hairdresser name
Code:

CmbHair.AddItem "Choose a Hairdresser from the list"
    CmbHair.text = CmbHair.List(0)
    Set rs = CN.Execute("SELECT HairID, HairName FROM HairDressers ORDER BY HairID")
        Do While Not rs.EOF
        CmbHair.AddItem rs!HairName
        rs.MoveNext
      Loop

Code:

Private Sub CmbHair_Click()
Set rs = CN.Execute("SELECT * from Customers WHERE Optional LIKE '%" & RplS(CmbHair.text) & "%' ORDER BY Optional")
LsVw.ListItems.clear
While Not rs.EOF
  Set itm = Frmsms.LsVw.ListItems.Add(, , rs!FullName, , "sms")
            itm.Bold = True
            itm.SubItems(1) = rs!Cellular
            itm.SubItems(2) = rs!Optional
            rs.MoveNext
 
 Wend
End Sub


Viewing all articles
Browse latest Browse all 21174

Trending Articles



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