If txtYearKeyFore.Text = "" Or txtMonKeyFore.Text = "" Or txtYearKeyBack.Text = "" Or txtMonKeyBack.Text = "" Then
MsgBox "请完整填写查询时间!", vbOKOnly + vbInformation, "查询" Exit Sub End If
If wherestr <> "" Then
If optnTimeand.Value Then
wherestr = wherestr + " and " Else
wherestr = wherestr + " or " End If End If
wherestr = wherestr + "acceptancetime between '" & txtYearKeyFore.Text + "-" + txtMonKeyFore.Text & "'and '" & txtYearKeyBack.Text + "-" + txtMonKeyBack.Text & "'" End If End If
If wherestr <> "" Then
wherestr = "where " + wherestr End If
sqlstr = sqlstr + wherestr
http://www.77cn.com.cnmands("cmdFindStudent").CommandText = sqlstr '刷新Grid,这两句不可省 DataE.conLibrary.Close DataE.conLibrary.Open DataE.cmdfindstudent dgrdResult.ClearFields
dgrdResult.DataMember = http://www.77cn.com.cnmands("cmdFindStudent").Name dgrdResult.DefColWidth = 3000 dgrdResult.ReBind
If DataE.rscmdFindStudent.RecordCount <> 0 Then dgrdResult.Columns(0).Button = True Else
MsgBox "在数据库中没找到要查询的对象", vbOKOnly + vbInformation, "查询失败" End If End Sub
Private Sub dgrdResult_ButtonClick(ByVal ColIndex As Integer) Dim col As Column Dim sqlstr As String
Dim strColumn As String