DarrenWard
IS-IT--Management
I have an ActiveX on a form and also an ActiveX Bound Control.
And the following code;
CREATE CURSOR _report (bcText c(50), BC g)
SELECT _report
APPEND BLANK
REPLACE bcText WITH "123456789"
APPEND GENERAL BC CLASS TBarCode5.TBarCode5
WITH THISFORM.BoundControl
.CONTROLSOURCE = "_report.BC"
.BarCode = 16
.PrintDataText = .F.
.REFRESH
.Text = "123456789"
.REFRESH
ENDWITH
REPORT FORM 'rp032' NEXT 1 TO PRINTER NOCONSOLE
thisform.Barcode_Invisible.ControlSource = ""
USE
SELECT WWO
The report has a bound control pointing to BC and a couple of text boxes, if I execute the code I get a "Variable 'BC' is not found" error, but if I direct the print to the screen or insert a 'BROWSE' command just before the 'REPORT FORM' it works find!!! Although if I send output to screen and then click on the print button on the print preview toolbox I get the error again.
Another thing that I have noticed is that when the 'USE' is processed it closes the table WWO and not _Report, and if I ommit the 'USE' command WWO ends up at eof as if the report had been run using this table, it makes no sence, I have the same code running on other forms and it works direct to printer ok.
Darren
GuiltyMaggot - The best rock band in the world!
And the following code;
CREATE CURSOR _report (bcText c(50), BC g)
SELECT _report
APPEND BLANK
REPLACE bcText WITH "123456789"
APPEND GENERAL BC CLASS TBarCode5.TBarCode5
WITH THISFORM.BoundControl
.CONTROLSOURCE = "_report.BC"
.BarCode = 16
.PrintDataText = .F.
.REFRESH
.Text = "123456789"
.REFRESH
ENDWITH
REPORT FORM 'rp032' NEXT 1 TO PRINTER NOCONSOLE
thisform.Barcode_Invisible.ControlSource = ""
USE
SELECT WWO
The report has a bound control pointing to BC and a couple of text boxes, if I execute the code I get a "Variable 'BC' is not found" error, but if I direct the print to the screen or insert a 'BROWSE' command just before the 'REPORT FORM' it works find!!! Although if I send output to screen and then click on the print button on the print preview toolbox I get the error again.
Another thing that I have noticed is that when the 'USE' is processed it closes the table WWO and not _Report, and if I ommit the 'USE' command WWO ends up at eof as if the report had been run using this table, it makes no sence, I have the same code running on other forms and it works direct to printer ok.
Darren
GuiltyMaggot - The best rock band in the world!