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

error type mismatch in query epression

$
0
0
im getting a error type mismatch when i try to get the history of a customer

cant find exactly where is the mismatch

Name:  123.jpg
Views: 33
Size:  294.0 KB

this is my code
Code:

Dim strSQL As String
Dim lngVal As Long
lngVal = CLng(FrmCusts.LsVw.SelectedItem.Tag)
strSQL = "SELECT "
strSQL = strSQL & "Appointments.AppID,"
strSQL = strSQL & "Appointments.AppDate,"
strSQL = strSQL & "Appointments.AppCust,"
strSQL = strSQL & "Appointments.AppHair,"
strSQL = strSQL & "Appointments.AppTimein,"
strSQL = strSQL & "Appointments.AppTimeout,"
strSQL = strSQL & "Appointments.AppTreatment,"
strSQL = strSQL & "Appointments.AppRemarks,"
strSQL = strSQL & "Customers.FullName,"
strSQL = strSQL & "HairDressers.HairName"
strSQL = strSQL & " FROM Appointments, Customers, HairDressers "
strSQL = strSQL & " WHERE Customers.ID = " & CStr(lngVal)
strSQL = strSQL & " AND Appointments.AppCust = Customers.ID"
strSQL = strSQL & " AND HairDressers.HairID = Appointments.AppHair"
MsgBox strSQL
Set RptCust.DataSource = CN.Execute(strSQL)
RptCust.Show 1


this are the tables:
Appointments

AppID
AppDate
AppCust
AppHair
AppTimein
AppTimeout
AppTreatment
AppRemarks
--------------
HairDressers

HairID
HairName

tnx in advanced
Attached Images
 

Viewing all articles
Browse latest Browse all 21090

Trending Articles



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