Posted on 2003-02-19
I want to display in a data grid control only the recordsets queried from a table and I want it to clear and display the new results when I do a new query.
The control is bound to the database's table ok, displays all the current data.
this is what I got:
adodc's(in this case is called dcVideo) command is set to adcmdtext
Dim strSQL As String
strSQL = "select * from films1 where "
If strvalue = 1 Then
If Option1.Value = True Then
strSQL = strSQL & "year=2000"
If Option2.Value = True Then
strSQL = strSQL & "year>1989"
If Option3.Value = True Then
strSQL = strSQL & "year>1979 and year<1990"
If Option4.Value = True Then
strSQL = strSQL & "year<1979"
ElseIf strvalue = 2 Then
strSQL = strSQL & "oscar_award=A"
ElseIf strvalue = 3 Then
strSQL = strSQL & "categories=List1.Text"
.RecordSource = strSQL
for some reason it works fine when strvalue=1 but it doesn't work with the other two, everything goes fine until it gets to the refresh of dcvideo ("no value given for one or more parameters"), the string given to the recordsource is the right one.
Any idea please?(I'm going nuts)