I’m new to this so please be kind.
I am creating a simple inventory db. I have a form that we enter into the table inventory. Right now we enter in everything once as inventory, then again to out to coating or ship to customer. I’m looking for the code to create a button enter the record twice but make two fields change.
So in short terms I want the form to enter a record with all the data as displayed. Then create another record with all the same data but the quantity would need to change to a negative and the Status would change to “Coating”.
I know this code won't work but this is what I want to do.
Private Sub Command78_Click()
.AddNew
!Employee = Me!Combo68
!Material = Me!Combo48
!Length = Me!Combo29
!Caliber = Me!Combo31
!Twist = Me!Combo33
!Style = Me!Combo35
!GasSystem = Me!Combo44
!GasPort = Me!Combo37
!Marking = Me!Combo58
!Finish = Me!Combo60
!Quantity = Me!Text64
!Status = Me!Combo62 'Default value "Inventory"
.AddNew
!Employee = Me!Combo68
!Material = Me!Combo48
!Length = Me!Combo29
!Caliber = Me!Combo31
!Twist = Me!Combo33
!Style = Me!Combo35
!GasSystem = Me!Combo44
!GasPort = Me!Combo37
!Marking = Me!Combo58
!Finish = Me!Combo60
!Quantity = Me!Text64 * -1
!Status = Me!Combo79 'Default value "Coating"
DoCmd.Close
End Sub
I am creating a simple inventory db. I have a form that we enter into the table inventory. Right now we enter in everything once as inventory, then again to out to coating or ship to customer. I’m looking for the code to create a button enter the record twice but make two fields change.
So in short terms I want the form to enter a record with all the data as displayed. Then create another record with all the same data but the quantity would need to change to a negative and the Status would change to “Coating”.
I know this code won't work but this is what I want to do.
Private Sub Command78_Click()
.AddNew
!Employee = Me!Combo68
!Material = Me!Combo48
!Length = Me!Combo29
!Caliber = Me!Combo31
!Twist = Me!Combo33
!Style = Me!Combo35
!GasSystem = Me!Combo44
!GasPort = Me!Combo37
!Marking = Me!Combo58
!Finish = Me!Combo60
!Quantity = Me!Text64
!Status = Me!Combo62 'Default value "Inventory"
.AddNew
!Employee = Me!Combo68
!Material = Me!Combo48
!Length = Me!Combo29
!Caliber = Me!Combo31
!Twist = Me!Combo33
!Style = Me!Combo35
!GasSystem = Me!Combo44
!GasPort = Me!Combo37
!Marking = Me!Combo58
!Finish = Me!Combo60
!Quantity = Me!Text64 * -1
!Status = Me!Combo79 'Default value "Coating"
DoCmd.Close
End Sub
Last edited: