|
我在主窗体那form_load()有了docmd.gotorecord,,aclast,但现在有个问题是当我点了子窗体的任意一个地方它都会自动跑回第一条记录那,还有就是为什么子窗体刷新那么慢?才4000多条记录啊
我那保存按钮的代码是
Private Sub Command1_Click()
On Error GoTo Err_command1_Click
Dim stemp As String
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
stemp = "select * from 报表"
rs.Open stemp, CurrentProject.Connection, adOpenKeyset, adLockOptimistic
If Me![Text0] <> "" And Me![Text1] <> "" And Me![Text2] <> "" And Me![Text3] <> "" And Me![Text4] <> "" Then
rs.AddNew
rs("日期") = Me![Text0]
rs("工号") = Me![Text2]
rs("组别") = Me![Text1]
rs("姓名") = Me![Text3]
rs("号数") = Me![Text4]
rs("级别") = Me![Text6]
rs("面数&厚薄") = Me![Text10]
rs("板号") = Me![Text11]
rs("中数") = Me![Text12]
rs("颜色") = Me![Text8]
rs("数量") = Me![Text13]
rs.Update
MsgBox "添加成功", vbExclamation, "提示"
DoCmd.GoToRecord , , acLast
Me![Text9] = ""
Me![Text10] = ""
Me![Text11] = ""
Me![Text12] = ""
Me![Text13] = ""
Me![Text1].SetFocus
Me.发钻子窗体.Requery
Set rs = Nothing
Else
MsgBox "除编号外所有数据都不能为空", vbExclamation, "提示"
Me![Text1].SetFocus
End If
Exit_command1_Click:
Exit Sub
Err_command1_Click:
Resume Exit_command1_Click
End Sub
有没有问题? |
|