I have this code and it is comming back with an error
fla$ = "c:\reports\weekly.rpt"
open fla$ of input as #1
width #1, 140
print #1,"weekly report"
close #1
i am getting an error message on the width line
can you please help
thanks
dave
Printable View
I have this code and it is comming back with an error
fla$ = "c:\reports\weekly.rpt"
open fla$ of input as #1
width #1, 140
print #1,"weekly report"
close #1
i am getting an error message on the width line
can you please help
thanks
dave
On your line that reads open fla$ of input as #1, replace the of with for.
Try "For Input..." instead of "OF"
Steph
i think the file has to be open for output.
Im sure thats a typo guys, or else it would have errored on that line..not the width line
Cander's right, it should be for output according to MSDN, ... sorry about the typo but it was to easy !...
Steph
sorry guys yes that is a type error. th code is
open fla$ for output as #1
width #1, 140
the error is invalid use of property.
please help
Microsoft KnowledgeBase article Q145678 confirms that this is a problem when the code you are trying to use is in a form and the example given in MSDN also doesn't work. However the problem only occurs if the code is in a form, so if you move it to a module or class it will work (I tried it).