错误3265,数据表中有些数据集合可以读出,有些读不出
程序代码:
Private Sub Command1_Click() 'Unload Me frmAppend.Show End Sub Private Sub Command2_Click() 'Unload Me frmQuery.Show End Sub Private Sub Command3_Click() If MsgBox("是否要删除 " & MSFlexGrid.TextMatrix(MSFlexGrid.Row, 1) & " 的数据?", vbQuestion + vbYesNo) = vbNo Then Exit Sub recjyxx.MoveFirst recjyxx.Move MSFlexGrid.Row - 1 recjyxx.Delete For i = MSFlexGrid.Row To MSFlexGrid.Rows - 2 For j = 0 To MSFlexGrid.Cols - 1 MSFlexGrid.TextMatrix(i, j) = MSFlexGrid.TextMatrix(i + 1, j) Next Next MSFlexGrid.Rows = MSFlexGrid.Rows - 1 End Sub Private Sub Command4_Click() End End Sub Private Sub Form_Load() Dim i As Integer Set db = OpenDatabase(App.Path & "\MIS.mdb", False, False) '打开数据库 Set recjyxx = db.OpenRecordset("加油信息表") '打开记录集 MSFlexGrid.FormatString = "^序号|<单 位 名 称|<客户名称|< 车 牌 号 |>加油型号|>油单价|>加油量|>单次加油金额|>月份" MSFlexGrid.Rows = recjyxx.RecordCount + 1 For i = 1 To MSFlexGrid.Rows - 1 MSFlexGrid.TextMatrix(i, 0) = i Next i = 0 With recjyxx Do While Not .EOF i = i + 1 MSFlexGrid.TextMatrix(i, 1) = !单位名称 MSFlexGrid.TextMatrix(i, 2) = !客户名称 MSFlexGrid.TextMatrix(i, 3) = !车牌号 MSFlexGrid.TextMatrix(i, 4) = !加油型号 MSFlexGrid.TextMatrix(i, 5) = !油单价 MSFlexGrid.TextMatrix(i, 6) = !加油量 MSFlexGrid.TextMatrix(i, 7) = !单次加油金额 MSFlexGrid.TextMatrix(i, 8) = !月份 .MoveNext Loop End With End Sub Private Sub Form_Resize() MSFlexGrid.Width = Me.ScaleWidth - MSFlexGrid.Left MSFlexGrid.Height = Me.ScaleHeight - MSFlexGrid.Top End Sub Private Sub Form_Unload(Cancel As Integer) recjyxx.Close db.Close End Sub单位名称,车牌号,加油型号,单次加油金额和月份都显示这个集合中找不到该项目[local]1[/local]