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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • wassimdaccache
    New Member
    • Apr 2007
    • 222

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

    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.

    Code:
    MsgBox [total]
    Me.amountlabel.Caption =number2string(total)
    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
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32656

    #2
    Which event triggers your code to run (Which event procedure is it within)?

    Comment

    • NeoPa
      Recognized Expert Moderator MVP
      • Oct 2006
      • 32656

      #3
      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).
      Code:
      Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
          Me.Label3.Caption = Me.Text2
      End Sub

      Comment

      • wassimdaccache
        New Member
        • Apr 2007
        • 222

        #4
        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

        Comment

        • NeoPa
          Recognized Expert Moderator MVP
          • Oct 2006
          • 32656

          #5
          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.

          Comment

          Working...