We value your feedback.
Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!
Private Sub Command133_Click() If Nz(Me.txtDate, "") = "" Then MsgBox "You must enter a date." Me.txtDate.SetFocus Exit Sub Else If Nz(Me.cboToLocation, "") = "" Then MsgBox "You must enter a To Location." Me.cboFromLocation.SetFocus Exit Sub Else If Nz(Me.txtProductID, "") = "" Then MsgBox "You must select a Product ID." Me.txtProductID.SetFocus Exit Sub Else If Nz(Me.txtQty, "") = "" Then MsgBox "You must enter a quantity." Me.txtQty.SetFocus Exit Sub Else End If End If End If End If If (MsgBox("Are you sure you want to transfer the inventory quantity of " & txtQty & " from " & txtFromName & " to " & txtToName & ".", vbYesNo)) = vbNo Then Cancel = True Else Dim RS As DAO.Recordset Set RS = CurrentDb.OpenRecordset("tblInventoryDetails") 'Code to add negative value to tblInventoryDetails RS.AddNew RS!TranxDate = Me.txtDate RS!SoldQty = Me.txtQty RS!ProductID = Me.txtProductID RS!LocationID = Me.cboFromLocation RS!InvTransfer = True RS.Update 'Code to add positive value to tblInventoryDetails RS.AddNew RS!TranxDate = Me.txtDate RS!IncomingQty = Me.txtQty RS!ProductID = Me.txtProductID RS!LocationID = Me.cboToLocation RS!InvTransfer = True RS.Update MsgBox "The inventory has been transferred." RS.Close Set RS = Nothing End If DoCmd.GoToRecord , "", acNewRec End Sub
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
|Access Form - Default Value UDF(). How can the UDF() know what control did the call||3||18|
|How force required field data entry before moving on to a new record||3||30|
|MS Access, hourly employee status||8||43|
|DB2 with VBA Pass Through Insert Into using a Form Command Button||5||29|