Hi my name is John from I U.K.. Have only recently got back into progarmming following the death of my wife in April this year, so could really do with help on a few things I am trying at the mo!
Other than computers my other interests are my lovely American Bulldod, Dixie, music(Bowie/Pistols/Nirvana/Paul Weller and all things goth!!), fishing and long walks in the countryside.. Anyway, the immediate problem I have is building an SQL string with possible parameters, but I get a missing operator error when I try and open the recordset. The code is as follows. The choice parameter is a radio button choice. I haven't got as far as passing dates yet. Please could someone help.
Kind Regards
John
'---------------------------------------------------------------------------
' Function: strbuildSQLstr
' Purpose: Build SQL String to retrieve ADO Recordset
' Paramters: strChoice- string(Good or Bad),strStart- string(start date)
' strEnd - string( End Date)
' Returns: String - SQL Statement build with parameters passed
'---------------------------------------------------------------------------
Function strbuildSQLstr(strChoice As String) As String
Dim strtemp As String
strtemp = "Select * from SizeRange Where Style =" & "'" & txtStyle & "'"
If strChoice > "" Then strtemp = strtemp & "'" & " and WHERE type =" & "'" & strChoice & "'"
' return the SQL String
strbuildSQLstr = strtemp & " " & "ORDER by Date"