I'm trying to take a number entered into a form, then update another table via a query with the same value so I don't have to enter the number multiple times. I've tried everything and nothing works. I'm sure there's a very simple way to do this.
I have a form (Transactions - Deposits) with a subform (Transactions - Deposits Subform). In the subform I enter an amount paid (AmountSubform is the box name), and then select my Invoice Number from a drop down box (InvoiceNumber is box name). I have an Event Procedure afterupdate that opens a query (Transactons - Deposit Query). I then search for the InvoiceNumber I chose, and then go to the record column AmtPaid for this invoice.
Private Sub InvoiceNumber_AfterUpdate()
Dim searchrecord As Integer
Dim capitalamt As Currency
searchrecord = InvoiceNumber
capitalamt = AmtPaid
DoCmd.OpenQuery ("Transactions - Deposit Query")
DoCmd.FindRecord searchrecord, acAnywhere, True, acSearchAll
DoCmd.GoToControl "AmtPaid"
This all works. What I can't do is copy the information from the subform (Transactions - Deposits Subform) box AmountSubform to the Query (Transactions - Deposit Query) column AmtPaid. Then close the query and close the main form and subform (I can do the closing part).
Any help much appreciated.
I have a form (Transactions - Deposits) with a subform (Transactions - Deposits Subform). In the subform I enter an amount paid (AmountSubform is the box name), and then select my Invoice Number from a drop down box (InvoiceNumber is box name). I have an Event Procedure afterupdate that opens a query (Transactons - Deposit Query). I then search for the InvoiceNumber I chose, and then go to the record column AmtPaid for this invoice.
Private Sub InvoiceNumber_AfterUpdate()
Dim searchrecord As Integer
Dim capitalamt As Currency
searchrecord = InvoiceNumber
capitalamt = AmtPaid
DoCmd.OpenQuery ("Transactions - Deposit Query")
DoCmd.FindRecord searchrecord, acAnywhere, True, acSearchAll
DoCmd.GoToControl "AmtPaid"
This all works. What I can't do is copy the information from the subform (Transactions - Deposits Subform) box AmountSubform to the Query (Transactions - Deposit Query) column AmtPaid. Then close the query and close the main form and subform (I can do the closing part).
Any help much appreciated.