Access 2002

HELP!

I set up a hazardous material table named tblReceivals with the following fields: MaterialName, QtyReceived, QtyDisposed, QtyRemained, etc.

I also set up a data entry form named frmReceivals where the user can populate the QtyReceived field for adding a new record. The QtyRemained field is not on this form.

How can I assign the input QtyReceived value to the QtyRemained value (these two fields should have the same values) in a new added record, using a frmReceivals event procedure?

THANKS!

Comments

  • : HELP!
    :
    : I set up a hazardous material table named tblReceivals with the following fields: MaterialName, QtyReceived, QtyDisposed, QtyRemained, etc.
    :
    : I also set up a data entry form named frmReceivals where the user can populate the QtyReceived field for adding a new record. The QtyRemained field is not on this form.
    :
    : How can I assign the input QtyReceived value to the QtyRemained value (these two fields should have the same values) in a new added record, using a frmReceivals event procedure?
    :
    : THANKS!
    :

    So long as... The form is based on the table and not a query (OR you can just add the QtyRemained field to the Query) QtyRemained is available to the form for updating. The following code should do the trick as long as the TextBox is named as below (edit where applicable).

    Private Sub txtQtyReceived_BeforeUpdate(Cancel As Integer)
    Me.QtyRemained = Me.QtyReceived
    MsgBox Str(Me.QtyRemained)
    End Sub


    -ray
  • : : HELP!
    : :
    : : I set up a hazardous material table named tblReceivals with the following fields: MaterialName, QtyReceived, QtyDisposed, QtyRemained, etc.
    : :
    : : I also set up a data entry form named frmReceivals where the user can populate the QtyReceived field for adding a new record. The QtyRemained field is not on this form.
    : :
    : : How can I assign the input QtyReceived value to the QtyRemained value (these two fields should have the same values) in a new added record, using a frmReceivals event procedure?
    : :
    : : THANKS!
    : :
    :
    : So long as... The form is based on the table and not a query (OR you can just add the QtyRemained field to the Query) QtyRemained is available to the form for updating. The following code should do the trick as long as the TextBox is named as below (edit where applicable).
    :
    : Private Sub txtQtyReceived_BeforeUpdate(Cancel As Integer)
    : Me.QtyRemained = Me.QtyReceived
    : MsgBox Str(Me.QtyRemained)
    : End Sub
    :
    :
    : -ray
    :

    Ray -- Thanks for your help. I got it to work.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories