|
Private Sub REGIST_BTN_Click()
On Error GoTo Exit_REGIST
Dim dbs As Database, rst As Recordset
Set dbs = OpenDatabase(StrMasterDrv & "SPCMASTER.MDB")
Set rst = dbs.OpenRecordset("HIN_1")
Me!ITEM_CODE_BOX.SetFocus
rst.Index = "INDEX_2"
rst.Seek "=", Me!ItemHeadBox
Beep
If rst.NoMatch Then
If MsgBox("登録" & Me!ITEM_CODE_BOX & "?", vbQuestion + vbYesNo, "登録品目CODE") = vbYes Then
rst.AddNew
rst!H_CODE = Me!ItemHeadBox
rst!BUNRUI = Me!CHR_CMB
rst.Update
Me!LIST.Requery
End If
Else
MsgBox " " & Me!ITEM_CODE_BOX & " <- 已經登録 "
End If
rst.Close
dbs.Close
ClearData
Set dbs = Nothing
Set rst = Nothing
Exit_REGIST:
Err.Clear
Exit Sub
Err_No:
If Err.Number <> 2427 Then
MsgBox Err.Description
End If
Resume Exit_REGIST
End Sub
看看 |
|