HELP - Last Fields Content on a New record of a Form are empty when I print ...

R

Rui Oliveira

I'm programing with Microsoft Access 2003 an Invoice, so I have 2 Tables
Header and Lines both linked by the field InvoiveNumber.

On the "Detail" part of the form:

First are the data related with the Client and Invoice
(InvoiceNr(autonumber), Invoice date, Client Name,....)

Second it displays a subform related to lines of the Invoice, that is the
Products, price, quantity, value,...

At last the Vat tax and the total of the invoice and a button to print the
Invoice that is nothing more then a report.

Everything works fine BUT, there is always a BUT, the Vat tax and Invoice
Total are at zero in the Invoice Report, but when I hopen the data base is
ok and the values are correct.

So I think that when I push the Button "Print Invoice" the last two fields
are not yet updated, but When I Call the print procedure they become
updated, Isn't that right?

So what instruction in the code can I use to MS-Access Table that I called
"Header" to be updated?

Thanks in advance for any help.

Rui
 
J

John W. Vinson

I'm programing with Microsoft Access 2003 an Invoice, so I have 2 Tables
Header and Lines both linked by the field InvoiveNumber.

On the "Detail" part of the form:

First are the data related with the Client and Invoice
(InvoiceNr(autonumber), Invoice date, Client Name,....)

Second it displays a subform related to lines of the Invoice, that is the
Products, price, quantity, value,...

At last the Vat tax and the total of the invoice and a button to print the
Invoice that is nothing more then a report.

Everything works fine BUT, there is always a BUT, the Vat tax and Invoice
Total are at zero in the Invoice Report, but when I hopen the data base is
ok and the values are correct.

So I think that when I push the Button "Print Invoice" the last two fields
are not yet updated, but When I Call the print procedure they become
updated, Isn't that right?

So what instruction in the code can I use to MS-Access Table that I called
"Header" to be updated?

Thanks in advance for any help.

Rui

It sounds like the record has not yet been saved to disk (where the report can
find it) when the report is printed. Put an additional three lines in the
button code for the Print Invoice, before the OpenReport event:

If Me.Dirty Then
Me.Dirty = False
End If

This will force a disk write.
 

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

Top