ExitHere:
AddToList = acDataErrAdded
Exit Function
HandleErr:
AddToList = acDataErrDisplay
Select Case Err
Case Else
MsgBox Err & ": " & Err.Description, , _
"Form_HouseholdInventory.AddToList()"
End Select
Resume ExitHere
End Function
Private Sub Room_NotInList(NewData As String, Response As Integer)
' Add item to list
On Error GoTo HandleErr
If MsgBox("是否将此数据项添加到列表中?", _
vbYesNo + vbQuestion, "数据项不在列表中") = vbYes Then
Response = AddToList("房间", "房间", NewData)
Else
Response = acDataErrDisplay
End If
ExitHere:
Exit Sub
HandleErr:
Select Case Err
Case Else
MsgBox Err & ": " & Err.Description, , _
"Form_HouseholdInventory.Room_NotInList"
End Select
Resume ExitHere
Resume
End Sub
' cnCurrent.Close ' 不能关闭当前连接
' Set cnCurrent = Nothing
ExitHere:
' AddToList = acDataErrAdded
Exit Function
HandleErr:
AddToList = acDataErrDisplay
Select Case Err
Case Else
MsgBox Err & ": " & Err.Description, , _
"Form_HouseholdInventory.AddToList()"
End Select
Resume ExitHere
End Function
Private Sub Room_NotInList(NewData As String, Response As Integer)
' Add item to list
On Error GoTo HandleErr
If MsgBox("是否将此数据项添加到列表中?", _
vbYesNo + vbQuestion, "数据项不在列表中") = vbYes Then
Response = AddToList("房间", "房间", NewData)
Else
Response = acDataErrDisplay
End If
ExitHere:
Exit Sub
HandleErr:
Select Case Err
Case Else
MsgBox Err & ": " & Err.Description, , _
"Form_HouseholdInventory.Room_NotInList"
End Select
Resume ExitHere
' Resume
End Sub
[em28]