hatena
hatena
2020/08/26 (水) 11:05:38
別案
Private Sub btnInput_Click()
On Error GoTo ErrHandler
If Nz(Me.cmbP_Name, "") = "" Or Nz(Me.txtQty, "") = "" Then
MsgBox "Fill P_Name and transaction Quantitiy", vbExclamation, "Caution"
Exit Sub
End If
Dim sngQty As Single
If Nz(Me.opgTzT, "") = "" Then
MsgBox "Choice transaction type", vbExclamation, "Caution"
Exit Sub
ElseIf Me.opgTzT = 21 Or 22 Then
sngQty = Me.txtQty
Else
sngQty = Me.txtQty * -1
End If
' フォームのレコードセットに直接データ入力
With Forms!F_Display!sbf_Display.Form.RecordsetClone
.AddNew
!T_Time = Me.txtTzDate.Value
!P_ID = Me.cmbPName.Column(0)
!TID = Me.opgTzT
!Qty = sngQty
!Memo = Me.txtMemo
.Update
End With
db.Execute strSQL
MsgBox "Already Inputed"
Call initilizeForm
Exit Sub
ErrHandler:
MsgBox "Error #: " & Err.Number & vbNewLine & vbNewLine & _
Err.Description, vbCritical, "Error"
End Sub
通報 ...