Hello,
I need to have a query written in VBA and I am having problems with the WHERE paramater:
Can somebody help me?
Thank you
I need to have a query written in VBA and I am having problems with the WHERE paramater:
Code:
Private Sub Comando38_Click()
Dim strSQL As String, strOrder As String, strWhere As String
'This is the original SQL query
'SELECT Projetos.[Número], Projetos.[Nome], Projetos.Deadline, Projetos.DTPSimNao, Projetos.Sent
'FROM Projetos
'WHERE (((Projetos.[Nome do cliente]) <> "Terra") And ((Projetos.Sent) Is Null))
'ORDER BY Projetos.Deadline;
strSQL = "SELECT Projetos.[Número], Projetos.[Nome], Projetos.Deadline, Projetos.DTPSimNao, Projetos.Sent " & "FROM Projetos"
' This is where the problem lies:
strWhere = "WHERE"
strOrder = "ORDER BY Projetos.[Nome] ASC;"
strWhere = Mid(strWhere, 1, Len(strWhere) - 5)
Me.Lista915.RowSource = strSQL & " " & strWhere & "" & strOrder
End Sub
Can somebody help me?
Thank you