I'm having trouble including a integer variable into an SQL statement.
If I substitute the variable for the numeric 1, it works as expected.
The code is:-
I'm having trouble with the strWhereStatement line and the variable at the end of the statement (AND ((DocumentLibrary.ClientId)= " & intClientId & " )) ;"
Any help would be appreciated
If I substitute the variable for the numeric 1, it works as expected.
The code is:-
Code:
Dim intClientId As Integer
Dim strSQL As String
Dim rs As DAO.Recordset
Dim strWhereStatement As String
Dim strQryFile As String
intClientId = [Forms]![ViewPrintSendClientFrm]![ClientId]
Set db = CurrentDb
strQryFile = "DocumentLibrary"
strWhereStatement = " WHERE (((DocumentLibrary.MatterId)=0) AND ((DocumentLibrary.Attached)=True) AND ((DocumentLibrary.ClientId)= " & intClientId & " )) ;"
strQryFileSql = "SELECT * FROM " & strQryFile & strWhereStatement
I'm having trouble with the strWhereStatement line and the variable at the end of the statement (AND ((DocumentLibrary.ClientId)= " & intClientId & " )) ;"
Any help would be appreciated