Questions

Answer for:

SQL Statement in VB6 Code

Message 9 of 12

View entire thread
+
0 Votes
kerry.millen

Dim strSuit As String
strSuit = cboPayCombo.Text

"SELECT
tblInfo.fldSuit,
tblInfo.fldRCR,
tblPayments.fldPDate,
tblPayments.fldPaid,
tblPayments.fldBalance,
tblPayments.fldCashier,
tblPayments.fldRecNum,
tblPayments.fldVchNum,
tblPayments.fldSuit
FROM
tblInfo,
tblPayments

WHERE
tblInfo.fldSuit=tblPayments.fldSuit
AND
tblPayments.fldSuit = '" & strSuit & "'"

The last part of your WHERE clause is doing this:
tblPayments.fldSuit = 'strSuit'"

Since strSuit is not a literal string but a string variable, shouldn't you be doing this?

tblPayments.fldSuit=strSuit"