I am using dataenvironment for generating datareport using the following code

Unload DataEnvironment1
DataEnvironment1.Connection1 = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\htm.mdb;Persist Security Info=False;Jet OLEDB:Database Password=pushhtm"
DataEnvironment1.Command1 Trim(op)
datareport1.Show


it is working well. I am using a form to input a record and use a print button with above code to print that record on a page. First I enter a record then click on print the inputted recrd is appear on the datarecord. But when I use

Datareport1.printreport false

it prints directly but not the current inputted record it print the record which i inputted first time. What is the problem can anyone solve my problem

Recommended Answers

All 3 Replies

you mean you input a record and it print directly. please use this code: printer.print Text1.text

I want to print using the datareport.
Is there any method to resolve the problem
Please reply

use

dataenvironment1.command1.cursorlocation=aduseclient

then show your report

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.