您好我正在研究患者管理工具,我希望患者参与状态字段为开放,关闭和重新打开。当我更改已关闭的患者以重新打开时,应将其添加为新记录而不是更新当前记录。我试图在“cmdsave”中检查状态,然后添加为新的或更新。 问题是每当我更改组合框时,即使在我单击保存命令之前,该值也会保存在表中。
Private Sub CmdSaveEng_Click()
On Error GoTo CmdSaveEng_Click_Err
On Error Resume Next
Call checkReopenexists
If pExists = False Then
saved = True
Call addNewRecord
Me.CmdSaveEng.Enabled = False
saved = False
Exit Sub
Else
saved = True
DoCmd.RunCommand acCmdSaveRecord
Me.CmdSaveEng.Enabled = False
saved = False
If (MacroError <> 0) Then
Beep
MsgBox MacroError.Description, vbOKOnly, ""
End If
Beep
MsgBox "Data Saved Successfully", vbInformation, "Save"
End If
CmdSaveEng_Click_Exit:
Exit Sub
CmdSaveEng_Click_Err:
MsgBox Error$
Resume CmdSaveEng_Click_Exit
End Sub