Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Best way to create records for table not on form?

Status
Not open for further replies.

ReportMan

Programmer
Aug 13, 2001
40
US
I need to create new records for a table that is linked to my input table but is not on the form. What is the best method to do this? Do I use a query or VBA code? I am using Acces 2002. Any examples to help explain would be appreciated.

Thanks
 
Where are these records coming from?

You can proceduralize the creation of new records using a recordset object and a loop. Here is the basic process, without specific knowledge of your system it's the best we can do at the moment.


- Open Recordset object of your table
- Call AddNew method
- Assign data to field variables
- Call Update method
- Return to Call Addnew Method spot until finished
-Close Recordset








Me? Ambivalent? Well, yes and no....
Another free Access forum:
More Access stuff at
 
WildHare, Thanks for the reply. To give you more detail about the forms and files.

It is in some ways pretty simple and in others complex. The table being updated is Invoice Detail. The form being updated is a SubForm for Delivery Order Master. The Delivery Order is charged so much money each billing against a Funded Amount. The total charge against the DO can not be greater than the Funded Amount. The Invoice can and usually does contain charges against many different Delivery Orders.

I orginially had the charges being entered into the Invoice Detail Subform From the Invoice Master. The Delivery Order field was a combo box lookup. This all worked perfect until the client deceided that they wanted to input the charges against each DO so they could see all charges against that DO from all previous Invoices. The way I had the Delivery Order form setup was to have the Invoices Summary subform as query generated against Invoice Detail to show all charges for each DO.

Now I need to basicly swap this around. I created a new table, DO Invoice Detail to capture the DO charge by Invoice. This is now a subform on the Delivery Master form. I need to generate a Invoice Detail record every time a DO Invoice record is created on the DO Invoice subform. The Delivery Order Master and Invoice Detail tables are linked via DO Number.

If all this is not too confusing to follow, maybe you can go into greater detail as to the How To part.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top