VB6 Report problem, need help

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dalejasper
    New Member
    • Sep 2006
    • 1

    VB6 Report problem, need help

    I make a program using vb6, and link the database using adodc connection, I make also a report using the DataReport and DataEnvironment . When I print my report for the first time, It works very fine, but when i print it again using another entry the last report will be printed. I have to restart my program so that I can print another entry. Can anyone give me a solution to this prob. any help will be highly appreciated.
  • somaskarthic
    New Member
    • Aug 2006
    • 60

    #2
    Hi

    I'm not sure to say.
    But try this. Check whether u are loading the new report screen on each button click. There may be chances for your previous dataenvironment report existence. Unload the previous one and print it.

    -soamskarthic

    Originally posted by dalejasper
    I make a program using vb6, and link the database using adodc connection, I make also a report using the DataReport and DataEnvironment . When I print my report for the first time, It works very fine, but when i print it again using another entry the last report will be printed. I have to restart my program so that I can print another entry. Can anyone give me a solution to this prob. any help will be highly appreciated.

    Comment

    • swagata
      New Member
      • Sep 2006
      • 5

      #3
      Originally posted by somaskarthic
      Hi

      I'm not sure to say.
      But try this. Check whether u are loading the new report screen on each button click. There may be chances for your previous dataenvironment report existence. Unload the previous one and print it.

      -soamskarthic

      Hi

      try this

      myreport.refres h........

      myreport.show

      unload myreport

      I guess it should work...cause it worked for me...

      Comment

      • deepakpb
        New Member
        • Sep 2006
        • 5

        #4
        u can use the foloowing code before the print command of datareport
        DataEnvironment 1.rsCommand1.Op en
        DataEnvironment 1.rsCommand1.Re query
        DataEnvironment 1.rsCommand1.Cl ose

        if ur command is command1 then u have to use rscommand1
        if the above will not work then
        open the table from which u r taking printout and make use requery command and then close it using record set

        Comment

        Working...