|
不需要临时表- Private Sub CommandFind_Click()
- Dim Qdf As DAO.QueryDef
- Dim start As Date, endt As Date
- Dim sSQL As String
- If IsNull(Me.ComboBiao) Then
- MsgBox "请选择考试时间"
- Exit Sub
- End If
- If Not IsNull(Me.TextTup) Then
- start = Me.TextTup
- Else
- MsgBox "请输入开始日期"
- Exit Sub
- End If
- If Not IsNull(Me.TextTDown) Then
- endt = Me.TextTDown
- Else
- MsgBox "请输入结束日期"
- Exit Sub
- End If
- Set Qdf = CurrentDb.QueryDefs("A")
- sSQL = "SELECT 学生档案.ID, 姓名, 入学时间, 语文, 数学, 英语 FROM 学生档案 INNER JOIN " & _
- Me.ComboBiao & " ON 学生档案.ID = " & Me.ComboBiao & _
- ".ID WHERE 入学时间 between #" & start & "# and #" & endt & "#"
- Qdf.SQL = sSQL
- Me.ChildShow.SourceObject = "查询.A"
- Qdf.Close
- Set Qdf = Nothing
- End Sub
复制代码 |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|