Dim [B]temp[/B] As ???
If IsNull(Forms![复合查询窗体]![起始题号]) Then
[B]temp[/B] = "SELECT 试题属性.* FROM 试题属性 ;"
Else
[B]temp[/B] = "SELECT 试题属性.* FROM 试题属性 WHERE (((试题属性.题号)>=[forms]![复合查询窗体]![起始题号] ));"
End If
If IsNull(Forms![复合查询窗体]![终止题号]) Then
[B]temp[/B] = "SELECT [B]temp[/B].* FROM [B]temp[/B] ;"
Else
[B]temp[/B] = "SELECT [B]temp[/B].* FROM [B]temp[/B] WHERE ((([B]temp[/B].题号)<=[forms]![复合查询窗体]![终止题号] ));"
End If
' 打开记录集
strSQL = "Select ........"
Set temp = New ADODB.Recordset
With temp
Set .ActiveConnection = CurrentProject.Connection
.CursorLocation = adUseClient
.CursorType = adOpenKeyset
.Open strSQL
End With