vba mysql 没有为命令对象设置命令_没有为命令对象设置命令?

原文如下:PrivateSubCombo1_Click()SelectCaseCombo1.ListIndexCase0Label1.Caption="请选择日期:"Text1.Visible=FalseDTPicker1.Visible=TrueDTPicker2.Visible=TrueCase1Label1.C...

原文如下:

Private Sub Combo1_Click()

Select Case Combo1.ListIndex

Case 0

Label1.Caption = "请选择日期:"

Text1.Visible = False

DTPicker1.Visible = True

DTPicker2.Visible = True

Case 1

Label1.Caption = "请输入房间号"

Text1.Visible = True

DTPicker1.Visible = False

DTPicker2.Visible = False

End Select

End Sub

Private Sub Command1_Click()

Dim sql As String

Dim rs_find As New ADODB.Recordset

Dim conn As New ADODB.Connection

conn.Open "provider=Microsoft.Jet.OLEDB.4.0; data source=" & App.Path & "\db1.mdb;Persist Security Info=False"

If Label1.Caption = "请选择日期" Then

sql = "select [roomno] as 房间号,ruzhudate as 入住日期,deldate as 退房日期,paymoney as 应付金额 from deluser where deldate between #"

sql = sql & DTPicker1.Value & "# and #" & DTPicker2.Value & "#"

Else

If Label1.Caption = "请输入房间号" Then

sql = "select [roomno] as 房间号,ruzhudate as 入住日期,deldate as 退房日期,paymoney as 应付金额 from deluser where roomno='" & Text1.Text & "' "

End If

End If

rs_find.CursorLocation = adUseClient

rs_find.Open sql, conn, adOpenKeyset, adLockPessimistic

DataGrid1.AllowAddNew = False

DataGrid1.AllowDelete = False

DataGrid1.AllowUpdate = False

Set DataGrid1.DataSource = rs_find

Dim i As Integer

'Dim j As Integer

Dim j As String

'i = DataGrid1.Row

'j = DataGrid1.RecordSelectors

For i = 0 To DataGrid1.Row

'DataGrid1.FirstRow

j = j + DataGrid1.Columns(3)

'DataGrid1.Move

Next i

Text2.Text = j

End Sub

Private Sub Command2_Click()

Unload Me

End Sub

Private Sub Form_Load()

Combo1.AddItem "按时间段"

Combo1.AddItem "按 房 间"

End Sub

请在今天帮忙解决一下,急用。谢谢

展开

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值