2
在Access 2007年,我有一个表格到一个新的联系人添加到一个表:的MessageBox如果记录更新成功
RecSet.AddNew
RecSet![Code_Personal] = Me.txtCodePersonal.Value
RecSet![FName] = Me.TxtFName.Value
RecSet![LName] = Me.txtLName.Value
RecSet![Tel Natel] = Me.txtNatTel.Value
RecSet![Tel Home] = Me.txtHomeTel.Value
RecSet![Email] = Me.txtEmail.Value
RecSet.Update
这在目前的工作,接触已成功交锋。但我有两个问题:我想显示一个消息框,告诉接触已成功添加
- 因为
- 名称已经接触存在
- 不同的问题
然后分别显示一个消息框“联系已存在”或“错误发生”。
我这样做的想法是:
If recSet.Update = true Then
MsgBox "Paolo Bernasconi was successfully added"
Else if RecSet![FName] & RecSet![LName] 'already exist in table
MsgBox "Contact already exists"
Else
MsgBox "An unknown error occured"
我知道这个代码是错误的,显然是行不通的,但它只是给你的,我有什么想法试图实现。感谢您提前提供的所有帮助。