keep data for next record

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I use a form to update invoice information in a database. The invoices
consist of multiple lines -- each time through the form adds one line in the
database. The invoice number and date are the same for each line, and I'd
like to save users from having to enter this information each time through
the form. Is there a way to have the last entry made in these fields stay
the same unless the user overrides it?
 
Yes there is, but it seems that you are using a bad design. Sounds like you
are trying to create a spreadsheet when you are using a database program.
Relational databases don't require duplicate information like this. If the
invoice has multiple lines, then you should have two tables with a
one-to-many relationship....

TblInvoiceInfo
Invoice Number
InvoiceDate
VendorNumber
etc.

TblInvoiceDetails
InvNum
PartNumber
Qty


The date would only be entered for the main table, not on each detail line.
If you do your data entry in a subform, then the main form would contain the
invoice number and you would not need to enter it on your detail lines
assuming your relationship is set properly.

For more details, look at the sample database, Northwind and see how the
invoice forms and tables work. They do almost exactly what you are asking.
 
The problem is that it's not really multiple lines within an invoice but
mulitiple invoices under one master invoice number. Most of our vendors have
individual invoices but a few send us consolidated invoices, and it's the
consolidated invoice number that I want to repeat.

I haven't been able to get either of the code in the links to work yet but
I'll keep playing with it. Thanks!
 
Back
Top