Bear with me on this one.
I have an invoice form that links data from three databases. The main form is bound to a table in an Invoice DB (the main DB for the form). I have an unbound combobox (cboInvoiceVendor) used to select a Vendor from the Partner DB. The AfterUpdate event of this combobox requeries another combobox (cboPONumber) so that it shows the related PO Numbers for the Vendors. This data comes from a table linked from a PO DB. I also have a subform that displays the current amount (txtPOAmount) of the PO chosen from cboPONumber.
There are also a number of textboxes to input invoice amount (travel, consultation, air, etc). An unbound textbox (txtInvoiceTotal) keeps a summation of the line items for the invoice.
What I'd like to do is have the PO Amount (txtPOAmount) decrease by the amount shown in txtInvoiceTotal.
How would I go about doing that? I've tried a simple AfterInput event in txtInvoiceTotal that didn't work.
Here are the table layouts/relationships:
tblInvoices
InvoiceID
POID
InvoiceNumber
InvoiceDate
A few more fields
tblPO linked from PO_be.mdb
POID
PONumber
POAmount
CompanyID
tblCompany linked from partner_be.mdb
CompanyID
CompanyName
A few more fields
Any suggestions as to how I would go about getting this to work? Is it possible to change records in another database?
Thanks in advance.
I have an invoice form that links data from three databases. The main form is bound to a table in an Invoice DB (the main DB for the form). I have an unbound combobox (cboInvoiceVendor) used to select a Vendor from the Partner DB. The AfterUpdate event of this combobox requeries another combobox (cboPONumber) so that it shows the related PO Numbers for the Vendors. This data comes from a table linked from a PO DB. I also have a subform that displays the current amount (txtPOAmount) of the PO chosen from cboPONumber.
There are also a number of textboxes to input invoice amount (travel, consultation, air, etc). An unbound textbox (txtInvoiceTotal) keeps a summation of the line items for the invoice.
What I'd like to do is have the PO Amount (txtPOAmount) decrease by the amount shown in txtInvoiceTotal.
How would I go about doing that? I've tried a simple AfterInput event in txtInvoiceTotal that didn't work.
Code:
[Forms]![frmInvoice]![sfrmPOAmount].Form![txtPOAmount] = [Forms]![frmInvoice]![sfrmPOAmount].Form![txtPOAmount] - Me.txtInvoiceTotal
Here are the table layouts/relationships:
tblInvoices
InvoiceID
POID
InvoiceNumber
InvoiceDate
A few more fields
tblPO linked from PO_be.mdb
POID
PONumber
POAmount
CompanyID
tblCompany linked from partner_be.mdb
CompanyID
CompanyName
A few more fields
Any suggestions as to how I would go about getting this to work? Is it possible to change records in another database?
Thanks in advance.