By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,587 Members | 1,076 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,587 IT Pros & Developers. It's quick & easy.

I am not able to use caption on label in my report!!!

100+
P: 222
Hello everybody,


I have a report (invoice) I made module called "number2string"(int double) as string

My module takes the number and return to me the number written as string. Example number2string(4)="four"

Every time I print out my reports I need the sum of [total] be written in a label called amountlabel.

I use this code it is working well when I open "Invoice" but not on printing out.

Expand|Select|Wrap|Line Numbers
  1. MsgBox [total]
  2. Me.amountlabel.Caption =number2string(total) 
  3.  
Where Do I have to put my code for each time we print out the invoice report the amountlabel will be filled automatically

NB: I tried to put it on page event and it is not working too.


Any suggestion about this subject.


CHEERS


WASSIM S DACCACHE
CCE
Jun 2 '08 #1
Share this Question
Share on Google+
4 Replies


NeoPa
Expert Mod 15k+
P: 31,485
Which event triggers your code to run (Which event procedure is it within)?
Jun 2 '08 #2

NeoPa
Expert Mod 15k+
P: 31,485
I put my code in the Format event procedure of the Detail section (where my label is) and it works without problem (I'm using Access 2000 here).
Expand|Select|Wrap|Line Numbers
  1. Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
  2.     Me.Label3.Caption = Me.Text2
  3. End Sub
Jun 2 '08 #3

100+
P: 222
I was putting the code on "ON PAGE" event .it wasn't working there when I put it on "ON FORMAT" it works


Thank you NEO

Have a nice day


WASSIM S DACCACHE
CCE
Jun 2 '08 #4

NeoPa
Expert Mod 15k+
P: 31,485
No worries Wassim. The Page event is too late in the day to allow changes to data. It is simply to superimpose graphics onto the already created graphic of the page.
Jun 2 '08 #5

Post your reply

Sign in to post your reply or Sign up for a free account.