M
Marianne
Greetings!
Some day I hope to be really good at this, but that day <> today! So I
welcome your suggestions.
I am creating a db for simple invoicing, and payment history. no inventory
or purchasing. Invoices can have multiple line items. Each line item can have
multiple payments.
FrmInvoice1Edit - Main Form containing a tab control with 2 subforms
frmInvoiceDetail1Edit and frmPayments1Edit
when an invoice line item is paid in full:
The Paid field on frmInvoiceDetail1Edit should be set to True
the line item record in frmInvoiceDetail1Edit and frmPayments1Edit should be
locked to further editing, but without locking the rest of the unpaid
records and requery the data in a combobox that lists the available line
items that can be paid.
I put this code in the Form's after update event but get a Error 13 type
mismatch when the record tries to update. Don't know what to do to lock the
records.
Dim strTotalPymts As String
Dim strExtAmt As String
Dim varPaid As Variant
' Domain Sum to sum all the payments for each line item
strTotalPymts = DSum("Pymt", "PaymentDetail", "[PymtInvID] = " &
Me.PymtInvID And "[InvLineNum] =" & Me.InvLineNum)
strExtAmt = Forms!frmInvoice1Edit!frmInvoiceDetail1Edit.Form!ExtAmt
varPaid = Forms!frmInvoice1Edit!frmInvoiceDetail1Edit.Form!Paid
If strTotalPymts = strExtAmt Then varPaid = True
Me.cboSelectPaymentsList.Requery
Some day I hope to be really good at this, but that day <> today! So I
welcome your suggestions.
I am creating a db for simple invoicing, and payment history. no inventory
or purchasing. Invoices can have multiple line items. Each line item can have
multiple payments.
FrmInvoice1Edit - Main Form containing a tab control with 2 subforms
frmInvoiceDetail1Edit and frmPayments1Edit
when an invoice line item is paid in full:
The Paid field on frmInvoiceDetail1Edit should be set to True
the line item record in frmInvoiceDetail1Edit and frmPayments1Edit should be
locked to further editing, but without locking the rest of the unpaid
records and requery the data in a combobox that lists the available line
items that can be paid.
I put this code in the Form's after update event but get a Error 13 type
mismatch when the record tries to update. Don't know what to do to lock the
records.
Dim strTotalPymts As String
Dim strExtAmt As String
Dim varPaid As Variant
' Domain Sum to sum all the payments for each line item
strTotalPymts = DSum("Pymt", "PaymentDetail", "[PymtInvID] = " &
Me.PymtInvID And "[InvLineNum] =" & Me.InvLineNum)
strExtAmt = Forms!frmInvoice1Edit!frmInvoiceDetail1Edit.Form!ExtAmt
varPaid = Forms!frmInvoice1Edit!frmInvoiceDetail1Edit.Form!Paid
If strTotalPymts = strExtAmt Then varPaid = True
Me.cboSelectPaymentsList.Requery