auto add new records

  • Thread starter Thread starter Lapchien
  • Start date Start date
L

Lapchien

I'd like to populate a table 'automatically', from a form:

The user inputs the first rows records:

Agreement
Startdate
Paymenthmethod
Reference

They then use a command button to add another 47 records, each record 1
calendar month apart from 'Startdate'. All other information remains the
same...

Thanks,
Lap
 
You could run a query that adds the 47 records. Run it
from the AfterUpdate Event. It sounds like your table
structure is not optimal.

Jim
 
I'd like to populate a table 'automatically', from a form:

The user inputs the first rows records:

Agreement
Startdate
Paymenthmethod
Reference

They then use a command button to add another 47 records, each record 1
calendar month apart from 'Startdate'. All other information remains the
same...

Thanks,
Lap

so... you want to store three fields *redundantly*, 47 times? I really
don't think that's either necessary or wise!

You can do it if you insist. I routinely put a table Num with one
long-integer field N, filled with values 1 to 10000, as a utility in
all of my databases.

You could create an Append query based on Num, with a criterion on N
of < 48, appending Agreement; DateAdd("m", N, [Startdate]),
PaymentMethod and Reference, and run this query from your button. But
I'd strongly suggest reexamining the table design!
 
The receipts table holds information about a set number of direct debit
payments to be made, this table drives a number of procedures, one for
example creates the file for the bank direct debit call. At the moment when
a new client buys the service, a user completes the information in a
spreadsheet (dragging down the first row 48 times to create 48 new records
with the date 1 month apart). I'd like her to be able to enter the new
receipts directly into a table and this is the only way to do it I think?

Lap


John Vinson said:
I'd like to populate a table 'automatically', from a form:

The user inputs the first rows records:

Agreement
Startdate
Paymenthmethod
Reference

They then use a command button to add another 47 records, each record 1
calendar month apart from 'Startdate'. All other information remains the
same...

Thanks,
Lap

so... you want to store three fields *redundantly*, 47 times? I really
don't think that's either necessary or wise!

You can do it if you insist. I routinely put a table Num with one
long-integer field N, filled with values 1 to 10000, as a utility in
all of my databases.

You could create an Append query based on Num, with a criterion on N
of < 48, appending Agreement; DateAdd("m", N, [Startdate]),
PaymentMethod and Reference, and run this query from your button. But
I'd strongly suggest reexamining the table design!
 
The receipts table holds information about a set number of direct debit
payments to be made, this table drives a number of procedures, one for
example creates the file for the bank direct debit call. At the moment when
a new client buys the service, a user completes the information in a
spreadsheet (dragging down the first row 48 times to create 48 new records
with the date 1 month apart). I'd like her to be able to enter the new
receipts directly into a table and this is the only way to do it I think?

Well, maybe, IF you want the user to enter data directly into a Table
datasheet. However, *that is a bad idea*. You're not using the tools
that Access provides!

I would suggest storing the constant client information in one table,
related one-to-many to a payment table. The user can then use a Form
based on the client table, with a Subform based on the payment table.

You're using spreadsheet thinking here. If you were implementing this
application in Excel, that would be appropriate. But Access *IS NOT* a
spreadsheet, and treating it as if it were will pretty much guarantee
a flawed implementation!
 
We're trying to stop using the Excel sheet (linked) and instead use Access
directly. Much better - but harder to understand I guess..!
 
Back
Top