2、如何在查询二次后在listview上排序?我在一个窗体上新建了一个listview,因需要必须在listview用SQL查询二次,然而在后一次查询时却因为日期先后和前一次查询的日期不能自动排序,造成如10月20日的记录(第一次查询)在前,10月2日的记录(第二次查询)在后,这样该如何排序?
8 个解决方案
#1
1.查看你的代码,估计是取编号之类的代码不完善
2.你第二次查询的时候按时间排序不就可以了
2.你第二次查询的时候按时间排序不就可以了
#2
关于新表不能增加记录的代码如下:
Private Sub CommandButton1_Click()
On Error Resume Next
If TextBox1 = "" Then
MsgBox "请输入正确的发货单号!", vbInformation, "DOVRO": Exit Sub
Else
Call neww
Call frmquery1
End If
TextBox1.Text = ""
End Sub
Sub neww()
Dim CNN As New ADODB.Connection
Dim RST As New ADODB.Recordset
Dim SQL As String
CNN.Open "provider=Microsoft.jet.OLEDB.4.0;data source=" & "\\" & dovrosource & "\dovro\sales.mdb"
SQL = "select * from voino"
RST.Open SQL, CNN, adOpenKeyset, adLockOptimistic, adCmdText
RST.MoveLast
If TextBox1.Text <> "" Then
With RST
.AddNew
.Fields("vono") = TextBox1.Text
.Update
End With
End If
RST.Close
Set CNN = Nothing
End Sub
Sub frmquery1()
ListView1.ListItems.Clear
Dim CNN As New ADODB.Connection
Dim RST As New ADODB.Recordset
Dim SQL As String
Dim i As Integer
CNN.Open "provider=Microsoft.jet.OLEDB.4.0;data source=" & "\\" & dovrosource & "\dovro\sales.mdb"
SQL = "Select * from voino order by ID"
RST.Open SQL, CNN, adOpenKeyset, adLockOptimistic
For i = 1 To RST.RecordCount
With ListView1.ListItems.Add(, , RST.Fields("ID"))
.SubItems(1) = RST.Fields("vono")
End With
RST.MoveNext
Next i
RST.Close
Set CNN = Nothing
End Sub
你帮我看看,所有有关的代码全在上面了!
Private Sub CommandButton1_Click()
On Error Resume Next
If TextBox1 = "" Then
MsgBox "请输入正确的发货单号!", vbInformation, "DOVRO": Exit Sub
Else
Call neww
Call frmquery1
End If
TextBox1.Text = ""
End Sub
Sub neww()
Dim CNN As New ADODB.Connection
Dim RST As New ADODB.Recordset
Dim SQL As String
CNN.Open "provider=Microsoft.jet.OLEDB.4.0;data source=" & "\\" & dovrosource & "\dovro\sales.mdb"
SQL = "select * from voino"
RST.Open SQL, CNN, adOpenKeyset, adLockOptimistic, adCmdText
RST.MoveLast
If TextBox1.Text <> "" Then
With RST
.AddNew
.Fields("vono") = TextBox1.Text
.Update
End With
End If
RST.Close
Set CNN = Nothing
End Sub
Sub frmquery1()
ListView1.ListItems.Clear
Dim CNN As New ADODB.Connection
Dim RST As New ADODB.Recordset
Dim SQL As String
Dim i As Integer
CNN.Open "provider=Microsoft.jet.OLEDB.4.0;data source=" & "\\" & dovrosource & "\dovro\sales.mdb"
SQL = "Select * from voino order by ID"
RST.Open SQL, CNN, adOpenKeyset, adLockOptimistic
For i = 1 To RST.RecordCount
With ListView1.ListItems.Add(, , RST.Fields("ID"))
.SubItems(1) = RST.Fields("vono")
End With
RST.MoveNext
Next i
RST.Close
Set CNN = Nothing
End Sub
你帮我看看,所有有关的代码全在上面了!
#3
二次查询不能按日期排序的SQL如下:
SQL = " SELECT nian as 年,yue as 月,ri as 日,con as 产品名称,'' as 发货单号,'' as 销售金额,je as 回款金额 FROM skd WHERE khmc like '%" & TextBox3.Text & "%' ORDER BY nian,yue,ri"
因为第一次查询时从其他表中取的数据是用“年,月,日”作这日期的,而在第二次查询的表中是“nian,yue,ri”作为日期字段的,在SQL中我用别名进行了统一,因为后面在输出到
listview上还要用到年月日,这时该如何排序呀?
另,我想进行筛选查询,用日期选择,我有两个文本框,这时的where语句又该如何写呀?
SQL = " SELECT nian as 年,yue as 月,ri as 日,con as 产品名称,'' as 发货单号,'' as 销售金额,je as 回款金额 FROM skd WHERE khmc like '%" & TextBox3.Text & "%' ORDER BY nian,yue,ri"
因为第一次查询时从其他表中取的数据是用“年,月,日”作这日期的,而在第二次查询的表中是“nian,yue,ri”作为日期字段的,在SQL中我用别名进行了统一,因为后面在输出到
listview上还要用到年月日,这时该如何排序呀?
另,我想进行筛选查询,用日期选择,我有两个文本框,这时的where语句又该如何写呀?
#4
1.
Sub neww()
Dim CNN As New ADODB.Connection
Dim RST As New ADODB.Recordset
Dim SQL As String
CNN.Open "provider=Microsoft.jet.OLEDB.4.0;data source=" & "\\" & dovrosource & "\dovro\sales.mdb"
SQL = "select * from voino"
RST.Open SQL, CNN, adOpenKeyset, adLockOptimistic, adCmdText
if not rst.eof then RST.MoveLast'这里这么改
...................
End Sub
2.什么意思?
Sub neww()
Dim CNN As New ADODB.Connection
Dim RST As New ADODB.Recordset
Dim SQL As String
CNN.Open "provider=Microsoft.jet.OLEDB.4.0;data source=" & "\\" & dovrosource & "\dovro\sales.mdb"
SQL = "select * from voino"
RST.Open SQL, CNN, adOpenKeyset, adLockOptimistic, adCmdText
if not rst.eof then RST.MoveLast'这里这么改
...................
End Sub
2.什么意思?
#5
我想在listview上做一个有关进销存的统计,然而我在做二次查询后却得到一个记录不按日期排序的表,并且在二次查询时也不是按条件进行统计,大家看看代码有什么不对的地方?主要是两句SQL语句肯定有问题,第二次查询中的nian,yue,ri为了方便用了别名和第一次查询时的一致,
我想得出的结论是1.二次查询都按日期进行排列,2.第二次查询按时间条件进行筛选,谢谢
Sub sgerdet()
Application.ScreenUpdating = False
CNN.Open "provider=Microsoft.jet.OLEDB.4.0;data source=" & "\\" & dovrosource & "\dovro\sales.mdb"
SQL = "SELECT 年,月,日,发货单号,产品名称,规格,数量,单位,金额 as 销售金额,'' as 回款金额 FROM sale " & _
" WHERE (((CDate([月] & '-' & [日] & '-' & [年])) Between #" & CDate(TextBox1.Text) & "# And #" & CDate(TextBox2.Text) & "#)) "
SQL = SQL & "and 发货单号 not like '%★%'"
SQL = SQL & "and 客户名称 like '%" & TextBox3.Text & "%' ORDER BY 年,月,日,发货单号"
RST.Open SQL, CNN, adOpenKeyset, adLockOptimistic
Do Until RST.EOF
With ListView1.ListItems.Add(, , RST.Fields("年"))
.SubItems(1) = RST.Fields("月")
.SubItems(2) = RST.Fields("日")
.SubItems(3) = RST.Fields("发货单号")
.SubItems(4) = RST.Fields("产品名称") & RST.Fields("规格") & " " & RST.Fields("数量") & RST.Fields("单位")
.SubItems(5) = Format(RST.Fields("销售金额"), "#,##0.00")
.SubItems(6) = Format(RST.Fields("回款金额"), "#,##0.00")
xsje = GetxsjeSum(ListView1.ListItems.Count)
.SubItems(7) = Format(qcje + xsje - hkje, "#,##0.00")
RST.MoveNext
End With
Loop
RST.Close
SQL = " SELECT nian as 年,yue as 月,ri as 日,con as 产品名称,'' as 发货单号,'' as 销售金额,je as 回款金额 FROM skd WHERE khmc like '%" & TextBox3.Text & "%' ORDER BY nian,yue,ri"
RST.Open SQL, CNN, adOpenKeyset, adLockOptimistic
Do Until RST.EOF
With ListView1.ListItems.Add(, , RST.Fields("年"))
.SubItems(1) = RST.Fields("月")
.SubItems(2) = RST.Fields("日")
.SubItems(3) = RST.Fields("发货单号")
.SubItems(4) = RST.Fields("产品名称")
.SubItems(5) = Format(RST.Fields("销售金额"), "#,##0.00")
.SubItems(6) = Format(RST.Fields("回款金额"), "#,##0.00")
hkje = GethkjeSum(ListView1.ListItems.Count)
.SubItems(7) = Format(qcje + xsje - hkje, "#,##0.00")
RST.MoveNext
End With
Loop
With ListView1.ListItems.Add
.SubItems(4) = " 本 月 合 计"
.SubItems(5) = IIf(IsNull(xsje), "", Format(xsje, "#,##0.00"))
.SubItems(6) = IIf(IsNull(hkje), "", Format(hkje, "#,##0.00"))
End With
RST.Close
Set CNN = Nothing
StatusBar1.Panels.Item(3) = " 截止到 " & TextBox2.Text & " 止客户应收款:" & Format(qcje + xsje - hkje, "#,##0.00") & "元"
Application.ScreenUpdating = True
End Sub
我想得出的结论是1.二次查询都按日期进行排列,2.第二次查询按时间条件进行筛选,谢谢
Sub sgerdet()
Application.ScreenUpdating = False
CNN.Open "provider=Microsoft.jet.OLEDB.4.0;data source=" & "\\" & dovrosource & "\dovro\sales.mdb"
SQL = "SELECT 年,月,日,发货单号,产品名称,规格,数量,单位,金额 as 销售金额,'' as 回款金额 FROM sale " & _
" WHERE (((CDate([月] & '-' & [日] & '-' & [年])) Between #" & CDate(TextBox1.Text) & "# And #" & CDate(TextBox2.Text) & "#)) "
SQL = SQL & "and 发货单号 not like '%★%'"
SQL = SQL & "and 客户名称 like '%" & TextBox3.Text & "%' ORDER BY 年,月,日,发货单号"
RST.Open SQL, CNN, adOpenKeyset, adLockOptimistic
Do Until RST.EOF
With ListView1.ListItems.Add(, , RST.Fields("年"))
.SubItems(1) = RST.Fields("月")
.SubItems(2) = RST.Fields("日")
.SubItems(3) = RST.Fields("发货单号")
.SubItems(4) = RST.Fields("产品名称") & RST.Fields("规格") & " " & RST.Fields("数量") & RST.Fields("单位")
.SubItems(5) = Format(RST.Fields("销售金额"), "#,##0.00")
.SubItems(6) = Format(RST.Fields("回款金额"), "#,##0.00")
xsje = GetxsjeSum(ListView1.ListItems.Count)
.SubItems(7) = Format(qcje + xsje - hkje, "#,##0.00")
RST.MoveNext
End With
Loop
RST.Close
SQL = " SELECT nian as 年,yue as 月,ri as 日,con as 产品名称,'' as 发货单号,'' as 销售金额,je as 回款金额 FROM skd WHERE khmc like '%" & TextBox3.Text & "%' ORDER BY nian,yue,ri"
RST.Open SQL, CNN, adOpenKeyset, adLockOptimistic
Do Until RST.EOF
With ListView1.ListItems.Add(, , RST.Fields("年"))
.SubItems(1) = RST.Fields("月")
.SubItems(2) = RST.Fields("日")
.SubItems(3) = RST.Fields("发货单号")
.SubItems(4) = RST.Fields("产品名称")
.SubItems(5) = Format(RST.Fields("销售金额"), "#,##0.00")
.SubItems(6) = Format(RST.Fields("回款金额"), "#,##0.00")
hkje = GethkjeSum(ListView1.ListItems.Count)
.SubItems(7) = Format(qcje + xsje - hkje, "#,##0.00")
RST.MoveNext
End With
Loop
With ListView1.ListItems.Add
.SubItems(4) = " 本 月 合 计"
.SubItems(5) = IIf(IsNull(xsje), "", Format(xsje, "#,##0.00"))
.SubItems(6) = IIf(IsNull(hkje), "", Format(hkje, "#,##0.00"))
End With
RST.Close
Set CNN = Nothing
StatusBar1.Panels.Item(3) = " 截止到 " & TextBox2.Text & " 止客户应收款:" & Format(qcje + xsje - hkje, "#,##0.00") & "元"
Application.ScreenUpdating = True
End Sub
#6
日期的话
再数据库里存储为日期字段,不是更好操作点吗
还用年,月,日,这样分开??难道有特殊需要?????
再数据库里存储为日期字段,不是更好操作点吗
还用年,月,日,这样分开??难道有特殊需要?????
#7
第一题
没有纪录的话
都不能movelast
何来的插新纪录呢
先看ret.recordcount是多少啊
没有纪录的话
都不能movelast
何来的插新纪录呢
先看ret.recordcount是多少啊
#8
zq972兄已经给出正解了!结贴!
#1
1.查看你的代码,估计是取编号之类的代码不完善
2.你第二次查询的时候按时间排序不就可以了
2.你第二次查询的时候按时间排序不就可以了
#2
关于新表不能增加记录的代码如下:
Private Sub CommandButton1_Click()
On Error Resume Next
If TextBox1 = "" Then
MsgBox "请输入正确的发货单号!", vbInformation, "DOVRO": Exit Sub
Else
Call neww
Call frmquery1
End If
TextBox1.Text = ""
End Sub
Sub neww()
Dim CNN As New ADODB.Connection
Dim RST As New ADODB.Recordset
Dim SQL As String
CNN.Open "provider=Microsoft.jet.OLEDB.4.0;data source=" & "\\" & dovrosource & "\dovro\sales.mdb"
SQL = "select * from voino"
RST.Open SQL, CNN, adOpenKeyset, adLockOptimistic, adCmdText
RST.MoveLast
If TextBox1.Text <> "" Then
With RST
.AddNew
.Fields("vono") = TextBox1.Text
.Update
End With
End If
RST.Close
Set CNN = Nothing
End Sub
Sub frmquery1()
ListView1.ListItems.Clear
Dim CNN As New ADODB.Connection
Dim RST As New ADODB.Recordset
Dim SQL As String
Dim i As Integer
CNN.Open "provider=Microsoft.jet.OLEDB.4.0;data source=" & "\\" & dovrosource & "\dovro\sales.mdb"
SQL = "Select * from voino order by ID"
RST.Open SQL, CNN, adOpenKeyset, adLockOptimistic
For i = 1 To RST.RecordCount
With ListView1.ListItems.Add(, , RST.Fields("ID"))
.SubItems(1) = RST.Fields("vono")
End With
RST.MoveNext
Next i
RST.Close
Set CNN = Nothing
End Sub
你帮我看看,所有有关的代码全在上面了!
Private Sub CommandButton1_Click()
On Error Resume Next
If TextBox1 = "" Then
MsgBox "请输入正确的发货单号!", vbInformation, "DOVRO": Exit Sub
Else
Call neww
Call frmquery1
End If
TextBox1.Text = ""
End Sub
Sub neww()
Dim CNN As New ADODB.Connection
Dim RST As New ADODB.Recordset
Dim SQL As String
CNN.Open "provider=Microsoft.jet.OLEDB.4.0;data source=" & "\\" & dovrosource & "\dovro\sales.mdb"
SQL = "select * from voino"
RST.Open SQL, CNN, adOpenKeyset, adLockOptimistic, adCmdText
RST.MoveLast
If TextBox1.Text <> "" Then
With RST
.AddNew
.Fields("vono") = TextBox1.Text
.Update
End With
End If
RST.Close
Set CNN = Nothing
End Sub
Sub frmquery1()
ListView1.ListItems.Clear
Dim CNN As New ADODB.Connection
Dim RST As New ADODB.Recordset
Dim SQL As String
Dim i As Integer
CNN.Open "provider=Microsoft.jet.OLEDB.4.0;data source=" & "\\" & dovrosource & "\dovro\sales.mdb"
SQL = "Select * from voino order by ID"
RST.Open SQL, CNN, adOpenKeyset, adLockOptimistic
For i = 1 To RST.RecordCount
With ListView1.ListItems.Add(, , RST.Fields("ID"))
.SubItems(1) = RST.Fields("vono")
End With
RST.MoveNext
Next i
RST.Close
Set CNN = Nothing
End Sub
你帮我看看,所有有关的代码全在上面了!
#3
二次查询不能按日期排序的SQL如下:
SQL = " SELECT nian as 年,yue as 月,ri as 日,con as 产品名称,'' as 发货单号,'' as 销售金额,je as 回款金额 FROM skd WHERE khmc like '%" & TextBox3.Text & "%' ORDER BY nian,yue,ri"
因为第一次查询时从其他表中取的数据是用“年,月,日”作这日期的,而在第二次查询的表中是“nian,yue,ri”作为日期字段的,在SQL中我用别名进行了统一,因为后面在输出到
listview上还要用到年月日,这时该如何排序呀?
另,我想进行筛选查询,用日期选择,我有两个文本框,这时的where语句又该如何写呀?
SQL = " SELECT nian as 年,yue as 月,ri as 日,con as 产品名称,'' as 发货单号,'' as 销售金额,je as 回款金额 FROM skd WHERE khmc like '%" & TextBox3.Text & "%' ORDER BY nian,yue,ri"
因为第一次查询时从其他表中取的数据是用“年,月,日”作这日期的,而在第二次查询的表中是“nian,yue,ri”作为日期字段的,在SQL中我用别名进行了统一,因为后面在输出到
listview上还要用到年月日,这时该如何排序呀?
另,我想进行筛选查询,用日期选择,我有两个文本框,这时的where语句又该如何写呀?
#4
1.
Sub neww()
Dim CNN As New ADODB.Connection
Dim RST As New ADODB.Recordset
Dim SQL As String
CNN.Open "provider=Microsoft.jet.OLEDB.4.0;data source=" & "\\" & dovrosource & "\dovro\sales.mdb"
SQL = "select * from voino"
RST.Open SQL, CNN, adOpenKeyset, adLockOptimistic, adCmdText
if not rst.eof then RST.MoveLast'这里这么改
...................
End Sub
2.什么意思?
Sub neww()
Dim CNN As New ADODB.Connection
Dim RST As New ADODB.Recordset
Dim SQL As String
CNN.Open "provider=Microsoft.jet.OLEDB.4.0;data source=" & "\\" & dovrosource & "\dovro\sales.mdb"
SQL = "select * from voino"
RST.Open SQL, CNN, adOpenKeyset, adLockOptimistic, adCmdText
if not rst.eof then RST.MoveLast'这里这么改
...................
End Sub
2.什么意思?
#5
我想在listview上做一个有关进销存的统计,然而我在做二次查询后却得到一个记录不按日期排序的表,并且在二次查询时也不是按条件进行统计,大家看看代码有什么不对的地方?主要是两句SQL语句肯定有问题,第二次查询中的nian,yue,ri为了方便用了别名和第一次查询时的一致,
我想得出的结论是1.二次查询都按日期进行排列,2.第二次查询按时间条件进行筛选,谢谢
Sub sgerdet()
Application.ScreenUpdating = False
CNN.Open "provider=Microsoft.jet.OLEDB.4.0;data source=" & "\\" & dovrosource & "\dovro\sales.mdb"
SQL = "SELECT 年,月,日,发货单号,产品名称,规格,数量,单位,金额 as 销售金额,'' as 回款金额 FROM sale " & _
" WHERE (((CDate([月] & '-' & [日] & '-' & [年])) Between #" & CDate(TextBox1.Text) & "# And #" & CDate(TextBox2.Text) & "#)) "
SQL = SQL & "and 发货单号 not like '%★%'"
SQL = SQL & "and 客户名称 like '%" & TextBox3.Text & "%' ORDER BY 年,月,日,发货单号"
RST.Open SQL, CNN, adOpenKeyset, adLockOptimistic
Do Until RST.EOF
With ListView1.ListItems.Add(, , RST.Fields("年"))
.SubItems(1) = RST.Fields("月")
.SubItems(2) = RST.Fields("日")
.SubItems(3) = RST.Fields("发货单号")
.SubItems(4) = RST.Fields("产品名称") & RST.Fields("规格") & " " & RST.Fields("数量") & RST.Fields("单位")
.SubItems(5) = Format(RST.Fields("销售金额"), "#,##0.00")
.SubItems(6) = Format(RST.Fields("回款金额"), "#,##0.00")
xsje = GetxsjeSum(ListView1.ListItems.Count)
.SubItems(7) = Format(qcje + xsje - hkje, "#,##0.00")
RST.MoveNext
End With
Loop
RST.Close
SQL = " SELECT nian as 年,yue as 月,ri as 日,con as 产品名称,'' as 发货单号,'' as 销售金额,je as 回款金额 FROM skd WHERE khmc like '%" & TextBox3.Text & "%' ORDER BY nian,yue,ri"
RST.Open SQL, CNN, adOpenKeyset, adLockOptimistic
Do Until RST.EOF
With ListView1.ListItems.Add(, , RST.Fields("年"))
.SubItems(1) = RST.Fields("月")
.SubItems(2) = RST.Fields("日")
.SubItems(3) = RST.Fields("发货单号")
.SubItems(4) = RST.Fields("产品名称")
.SubItems(5) = Format(RST.Fields("销售金额"), "#,##0.00")
.SubItems(6) = Format(RST.Fields("回款金额"), "#,##0.00")
hkje = GethkjeSum(ListView1.ListItems.Count)
.SubItems(7) = Format(qcje + xsje - hkje, "#,##0.00")
RST.MoveNext
End With
Loop
With ListView1.ListItems.Add
.SubItems(4) = " 本 月 合 计"
.SubItems(5) = IIf(IsNull(xsje), "", Format(xsje, "#,##0.00"))
.SubItems(6) = IIf(IsNull(hkje), "", Format(hkje, "#,##0.00"))
End With
RST.Close
Set CNN = Nothing
StatusBar1.Panels.Item(3) = " 截止到 " & TextBox2.Text & " 止客户应收款:" & Format(qcje + xsje - hkje, "#,##0.00") & "元"
Application.ScreenUpdating = True
End Sub
我想得出的结论是1.二次查询都按日期进行排列,2.第二次查询按时间条件进行筛选,谢谢
Sub sgerdet()
Application.ScreenUpdating = False
CNN.Open "provider=Microsoft.jet.OLEDB.4.0;data source=" & "\\" & dovrosource & "\dovro\sales.mdb"
SQL = "SELECT 年,月,日,发货单号,产品名称,规格,数量,单位,金额 as 销售金额,'' as 回款金额 FROM sale " & _
" WHERE (((CDate([月] & '-' & [日] & '-' & [年])) Between #" & CDate(TextBox1.Text) & "# And #" & CDate(TextBox2.Text) & "#)) "
SQL = SQL & "and 发货单号 not like '%★%'"
SQL = SQL & "and 客户名称 like '%" & TextBox3.Text & "%' ORDER BY 年,月,日,发货单号"
RST.Open SQL, CNN, adOpenKeyset, adLockOptimistic
Do Until RST.EOF
With ListView1.ListItems.Add(, , RST.Fields("年"))
.SubItems(1) = RST.Fields("月")
.SubItems(2) = RST.Fields("日")
.SubItems(3) = RST.Fields("发货单号")
.SubItems(4) = RST.Fields("产品名称") & RST.Fields("规格") & " " & RST.Fields("数量") & RST.Fields("单位")
.SubItems(5) = Format(RST.Fields("销售金额"), "#,##0.00")
.SubItems(6) = Format(RST.Fields("回款金额"), "#,##0.00")
xsje = GetxsjeSum(ListView1.ListItems.Count)
.SubItems(7) = Format(qcje + xsje - hkje, "#,##0.00")
RST.MoveNext
End With
Loop
RST.Close
SQL = " SELECT nian as 年,yue as 月,ri as 日,con as 产品名称,'' as 发货单号,'' as 销售金额,je as 回款金额 FROM skd WHERE khmc like '%" & TextBox3.Text & "%' ORDER BY nian,yue,ri"
RST.Open SQL, CNN, adOpenKeyset, adLockOptimistic
Do Until RST.EOF
With ListView1.ListItems.Add(, , RST.Fields("年"))
.SubItems(1) = RST.Fields("月")
.SubItems(2) = RST.Fields("日")
.SubItems(3) = RST.Fields("发货单号")
.SubItems(4) = RST.Fields("产品名称")
.SubItems(5) = Format(RST.Fields("销售金额"), "#,##0.00")
.SubItems(6) = Format(RST.Fields("回款金额"), "#,##0.00")
hkje = GethkjeSum(ListView1.ListItems.Count)
.SubItems(7) = Format(qcje + xsje - hkje, "#,##0.00")
RST.MoveNext
End With
Loop
With ListView1.ListItems.Add
.SubItems(4) = " 本 月 合 计"
.SubItems(5) = IIf(IsNull(xsje), "", Format(xsje, "#,##0.00"))
.SubItems(6) = IIf(IsNull(hkje), "", Format(hkje, "#,##0.00"))
End With
RST.Close
Set CNN = Nothing
StatusBar1.Panels.Item(3) = " 截止到 " & TextBox2.Text & " 止客户应收款:" & Format(qcje + xsje - hkje, "#,##0.00") & "元"
Application.ScreenUpdating = True
End Sub
#6
日期的话
再数据库里存储为日期字段,不是更好操作点吗
还用年,月,日,这样分开??难道有特殊需要?????
再数据库里存储为日期字段,不是更好操作点吗
还用年,月,日,这样分开??难道有特殊需要?????
#7
第一题
没有纪录的话
都不能movelast
何来的插新纪录呢
先看ret.recordcount是多少啊
没有纪录的话
都不能movelast
何来的插新纪录呢
先看ret.recordcount是多少啊
#8
zq972兄已经给出正解了!结贴!