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.
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:
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.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.