T
takeagoodlook911
Hello, I'm trying to create a method where a user selects some
criteria in a form and a query then generates the results. I have
been able to pass numbers successfully in the query but not text. If
anyone has an easy way of developing this let me know. The code below
works for numbers but not text Help me please.
Function BuildSQLString(strSQL As String) As Boolean
Dim strSELECT As String
Dim strFROM As String
Dim strWHERE As String
strSELECT = "s.*"
strFROM = "UFRRecords s "
If Check2 Then
strWHERE = strWHERE & " s.[FlagField1] = " & Combo0
End If
strSQL = "SELECT " & strSELECT
strSQL = strSQL & "FROM " & strFROM
If strWHERE <> "" Then strSQL = strSQL & "WHERE " & Mid$(strWHERE, 5)
BuildSQLString = True
End Function
* I believe the issue with text is occuring with "& Combo0 but im
clueless on how to reslove it.
criteria in a form and a query then generates the results. I have
been able to pass numbers successfully in the query but not text. If
anyone has an easy way of developing this let me know. The code below
works for numbers but not text Help me please.
Function BuildSQLString(strSQL As String) As Boolean
Dim strSELECT As String
Dim strFROM As String
Dim strWHERE As String
strSELECT = "s.*"
strFROM = "UFRRecords s "
If Check2 Then
strWHERE = strWHERE & " s.[FlagField1] = " & Combo0
End If
strSQL = "SELECT " & strSELECT
strSQL = strSQL & "FROM " & strFROM
If strWHERE <> "" Then strSQL = strSQL & "WHERE " & Mid$(strWHERE, 5)
BuildSQLString = True
End Function
* I believe the issue with text is occuring with "& Combo0 but im
clueless on how to reslove it.