Updating record on print preview

  • Thread starter Thread starter Sparky
  • Start date Start date
S

Sparky

I have a form that invoice text and amounts are entered before
printing.

The form has client name, address and the OrderID displayed from the
Orders table but I use unbound text boxes to enter amounts and
calculate tax etc on the form before printing.

My plan is to update the invoice total field in the orders table
(invtotal) with the calculated values in the form text boxes on
leaving the form to preview the report. I use a button on the form to
go to the report preview.

The report will display the updated values from the orders database.

The problem is how to update the orders fields on leaving the form.

Any ideas welcome!

Sparky
 
Build a recordset and use AddNew to add the items from the form into the
table. You can also use the Edit method to edit existing rows in the table,
ie rows which are created by the form. Alternatively, you could use and
Update query to update the record or an Append query to add a new one.

If that seems difficult, and you can't find the code example in the help
files, try adding some bound textboxes and setting their Visible property to
False. In the form's AfterUpdate event you can push the data into the bound
textboxes:

Me.txtBound1 = Me.txtUnbound1

etc.

Keep in mind that you almost never need to store calculated data, since it
can always be recalculated, and it is usually a violation of Normalization
rules to do so.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top