Hi,
I have a simple table [tblPaymentTerms]:
Creditor <text>
Terms <number>
and then form with field from another table: [tblInvoices].[Creditors]
I need to find creditor in tblPaymentTerms for currently displayed value on the form forms![Invoices].[Creditors] and return value [Terms] which I'd like to use for calculation on the form.
Now, the easiest way is to make query, but even if it returns one record I don't know how to pull it out and use on the form, eg. to get that value from query, add it to invoice date and enter into tblInvoices and display on the form at same time.
I was trying to use statement:
termX = DMax("[Payment_Period]", "tblPaymentTerm s", "[Creditor] = " & Me.Creditor)
Me.Payment_Due = termX + Me.Inv_Date
but it returns error: "the expression you entered as a query parameter produced this error 'MSTS'" - which is searched creditor currently displayed on the form.
PLease help.
Thanks.
I have a simple table [tblPaymentTerms]:
Creditor <text>
Terms <number>
and then form with field from another table: [tblInvoices].[Creditors]
I need to find creditor in tblPaymentTerms for currently displayed value on the form forms![Invoices].[Creditors] and return value [Terms] which I'd like to use for calculation on the form.
Now, the easiest way is to make query, but even if it returns one record I don't know how to pull it out and use on the form, eg. to get that value from query, add it to invoice date and enter into tblInvoices and display on the form at same time.
I was trying to use statement:
termX = DMax("[Payment_Period]", "tblPaymentTerm s", "[Creditor] = " & Me.Creditor)
Me.Payment_Due = termX + Me.Inv_Date
but it returns error: "the expression you entered as a query parameter produced this error 'MSTS'" - which is searched creditor currently displayed on the form.
PLease help.
Thanks.
Comment