0

I am having a challenge with Access 2016.

I have created a button to update one attribute with another. Example: QTY Value Quantity Request Value Remaining Stock Qty Value

I want to use a button to update the QTY value with the remaining stock qty value.

Private Sub Command67_Click()
Set QTY = QTY - QRAmount
Update Form_PartRequest
End Sub

But when I click the button nothing happens. What I'm missing?

sirandy
  • 1,834
  • 5
  • 27
  • 32
  • `Set` is for objects: https://stackoverflow.com/questions/349613/what-does-the-keyword-set-actually-do-in-vba – Andre Jun 27 '17 at 07:37

1 Answers1

0

If "attribute" means a field of the table the form is bound to, then:

Private Sub Command67_Click()

    Me!QTY.Value = Me!QTY.Value - Me!QRAmount.Value
    Me.Dirty = False

End Sub

Rename the controls to something meaningful.

Gustav
  • 53,498
  • 7
  • 29
  • 55