Report_CurrentRecord(): bad txt behaviour

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ezechiel
    New Member
    • Jul 2009
    • 53

    Report_CurrentRecord(): bad txt behaviour

    hi,

    ChipR gave me the hint of hidden combos to fill in textboxes with data from another table than the one 'linked' to the form (record source).

    this is the code I have in a form and this is working well.
    Code:
    Private Sub Form_Current()
        Me.txt_workbrowse_sopu = Me.cb_workbrowse_sopu.Column(1)
        Me.txt_workbrowse_sopu_nr = Me.cb_workbrowse_sopu.Column(2)
    End Sub
    so comboboxes (cb_abc..) are hidden ant txt visible of course.

    Now, I want to do the same thing in a report.
    So I put this code:
    Code:
    Private Sub Report_CurrentReport()
        Me.txt_instrep_sopu = Me.cb_instrep_sopu.Column(1)
        Me.txt_instrep_sopu_nr = Me.cb_instrep_sopu.Column(2)
    End Sub
    Everything is ok with the comboboxes, data corresponds with the current record in the report, but the textboxes don't update..

    Any ideas?
  • FishVal
    Recognized Expert Specialist
    • Jun 2007
    • 2656

    #2
    Does the second code ever run?

    Comment

    • ezechiel
      New Member
      • Jul 2009
      • 53

      #3
      lol good question.. apparently not..
      I tried MsgBox ("hello") but nothing displays..

      I'm not even sure _CurrentRecord is correct. But that is what I found in msdn library. Got any idea what else I could put instead of _CurrentRecord?

      Comment

      • FishVal
        Recognized Expert Specialist
        • Jun 2007
        • 2656

        #4
        Try each from report and report's section events.

        Kind regards,
        Fish.

        Comment

        • ezechiel
          New Member
          • Jul 2009
          • 53

          #5
          hi,

          sorry for the late reply, but what do you mean with 'report's section events'?

          I already tried with report events but with no result :(

          (I also noticed that access db has a strange behaviour. A couple of days ago, three 'options' of a form changed from yes to no (editable, and two others). And no one touched those...)

          Comment

          • ezechiel
            New Member
            • Jul 2009
            • 53

            #6
            For info:

            the report is opened by clicking on a button. The button launches the
            DoCmd.OpenRepor t stRepName, acPreview
            command

            Comment

            • FishVal
              Recognized Expert Specialist
              • Jun 2007
              • 2656

              #7
              Originally posted by ezechiel
              hi,

              sorry for the late reply, but what do you mean with 'report's section events'?

              ....
              Detail section, header section, footer section or ever where the control is located.

              Comment

              • ezechiel
                New Member
                • Jul 2009
                • 53

                #8
                ok, i'll try these things out and will come back with the result later.
                Thanks :)

                Comment

                Working...