frm Inventory - I need to write code when the numeric data entered into txtIssued is >0 then txtReceived be <1 and vice versa. This data needs to be stored into Sheet1. The txtIssued is in column C and the txtReceived is in column D.
Private Sub cmdCANCEL_Click()
Unload Me
End Sub
Private Sub cmdSAVE_CLICK()
ThisWorkbook.Save 'to save the current workbook
If Me.txtMaterial = "" Then
MsgBox "Please enter a Material Number.", vbExclamation, "Inventory"
Me.txtMaterial.SetFocus
Exit Sub
End If
If Me.txtBin = "" Then
MsgBox "Please enter a Bin Number.", vbExclamation, "Inventory"
Me.txtMaterial.SetFocus
Exit Sub
End If
If Me.txtIssued = "" Then
MsgBox "Please enter Issued Amount.", vbExclamation, "Inventory"
Me.txtMaterial.SetFocus
Exit Sub
End If
If Me.txtReceived = "" Then
MsgBox "Please enter Received Amount.", vbExclamation, "Inventory"
Me.txtMaterial.SetFocus
Exit Sub
End If
If Me.txtDate = "" Then
MsgBox "Please enter Todays Date.", vbExclamation, "Inventory"
Me.txtMaterial.SetFocus
Exit Sub
End If
If Me.cboDEPARTMENT = "" Then
MsgBox "Please choose a Department", vbExclamation, "Inventory"
Me.txtMaterial.SetFocus
Exit Sub
End If
If Me.txtRecipient = "" Then
MsgBox "Please enter Name of Recipient.", vbExclamation, "Inventory"
Me.txtMaterial.SetFocus
Exit Sub
End If
If Me.txtFaics = "" Then
MsgBox "Please enter Faics number.", vbExclamation, "Inventory"
Me.txtMaterial.SetFocus
Exit Sub
End If
If Me.cboInitials = "" Then
MsgBox "Please choose your Initials", vbExclamation, "Inventory"
Me.txtMaterial.SetFocus
Exit Sub
End If
If Not IsNumeric(Me.txtIssued) Then
MsgBox "The Issued box must contain a number.", vbExclamation, "Inventory"
Me.txtIssued.SetFocus
Exit Sub
End If
If Not IsDate(Me.txtDate) Then
MsgBox "The Date box must contain a date.", vbExclamation, "Inventory"
Me.txtDate.SetFocus
Exit Sub
End If
End Sub
Private Sub UserForm_Initialize()
Me.txtDate = Now
End Sub
Bookmarks