Office中国论坛/Access中国论坛
标题:
如何在保存后重新打开窗体
[打印本页]
作者:
冷弯
时间:
2004-12-25 06:57
标题:
如何在保存后重新打开窗体
Private Sub 命令36_Click()
Dim rst As Recordset, db As Database, I As Long
Set db = CurrentDb()
Set rst = db.OpenRecordset("表1")
For I = 1 To 8
If IsNull(Me("MC" & I)) = False Then
If IsNull(Me("DM")) = True Then
MsgBox "必须输入单位名称"
Exit Sub
End If
If IsNull(Me("XSY")) = True Then
MsgBox "必须输入经营主管"
Exit Sub
End If
If IsNull(Me("RQ")) = True Then
MsgBox "必须输入日期"
Exit Sub
End If
rst.AddNew
rst![DM] = Me("DM")
rst![日期] = Me("RQ")
rst![名称] = Me("MC" & I)
rst![规格] = Me("GG" & I)
rst![单位] = Me("DW" & I)
rst![数量] = Me("SL" & I)
rst![单重] = Me("DZ" & I)
rst![总重] = Me("ZZ" & I)
rst![单价] = Me("DJ" & I)
rst![金额] = Me("JE" & I)
rst![备注] = Me("BZ" & I)
rst![经营主管] = Me("XSY")
rst![保管员] = Me("BGY")
rst![开票人] = Me("KPR")
rst![编号] = Me("BH")
rst.Update
End If
Next I
MsgBox "保存成功"
DoCmd.GoToControl ("DM")
Me.命令36.Enabled = True
End Sub
怎样在保存后重新打开窗体,让DM字段为空,编号自动加1, 谢谢
作者:
cg1
时间:
2005-2-14 18:37
不需要重新打开的,只要把所有的文本框内容设置为 ="" 或者 =0 即可,编号=编号+1 即可
欢迎光临 Office中国论坛/Access中国论坛 (http://www.office-cn.net/)
Powered by Discuz! X3.3