3.我现在点击按钮(比如今日),按一下能把今天日期显示出来,按第2下,才能列出今天数据。 或者第二下点“确定”也能列出今天数据, 没看明白是怎么回事。 怎么改成按一次就能显示出来今天数据。
Dim wb5 As New WeUI
wb5.AddForm("", "form1", "list.htm")
With wb5.AddButtonGroup("form1", "btg2", False) '水平排列
.Add("btn3", "昨天", "submit").FormAction = "list.htm?btn=3"
.Add("btn1", "今日", "submit").FormAction = "list.htm?btn=1"
.Add("btn2", "明日", "submit").FormAction = "list.htm?btn=2"
.Add("btn4", "后天", "submit").FormAction = "list.htm?btn=4"
.Add("btn5", "确定", "submit").FormAction = "list.htm?btn=5"
End With
Selec* Case e.Path
Case "list.htm"
Dim flt As String
' e.WriteString(e.PostValues("startdate"))
If e.GetValues("btn") = 1 Then
With wb5.AddInputGroup("form1", "ipg1", "数据筛选")
.AddInput("startdate", "日期", "date").Value = date.Today 'e.PostValues("startdate")
End With
End If
If e.GetValues("btn") = 2 Then
With wb5.AddInputGroup("form1", "ipg1", "数据筛选")
.AddInput("startdate", "日期", "date").Value = Date.Today.AddDays(1) 'e.PostValues("startdate")
End With
End If
If e.GetValues("btn") = 3 Then
With wb5.AddInputGroup("form1", "ipg1", "数据筛选")
.AddInput("startdate", "日期", "date").Value = Date.Today.AddDays( - 1) 'e.PostValues("startdate")
End With
End If
If e.GetValues("btn") = 4 Then
With wb5.AddInputGroup("form1", "ipg1", "数据筛选")
.AddInput("startdate", "日期", "date").Value = Date.Today.AddDays(2) 'e.PostValues("startdate")
End With
End If
If e.GetValues("btn") = 5 Then
With wb5.AddInputGroup("form1", "ipg1", "数据筛选")
.AddInput("startdate", "日期", "date").Value = e.PostValues("startdate")
End With
End If
flt = "日期=' " & e.PostValues("startdate") & " '"
Dim cmd As New SQL1Command
cmd.C
cmd.CommandText = " Selec* 人数, 姓名, 手机, 酒店, 状态 From ({table_dingdan} Inner Join {table_kehu} On {table_kehu}.[idkehu] = {table_dingdan}.[idkehu]) "
If flt > "" Then
cmd.CommandText = cmd.CommandText & " where " & flt & " and 状态<>'取消' Order By 酒店 "
End If
With wb5.AddTable("", "Table1")
.CreateFromDataTable(cmd.ExecuteReader)
End With
End Select1
e.WriteString(wb5.Build)
此主题相关图片如下:ls.jpg