Link to home
Start Free TrialLog in
Avatar of themmer650
themmer650Flag for United States of America

asked on

Printer Wont print till exit

When i goto print my hplj5 just waits until i exit the program ? Prints fine once printed any suggestions? I thought printer.newpage was like a page feed  was i wrong?
Also i noticed that the date structure doesnt always work. Sometimes the date will be within the two dates i chose in other part of program but they dont print out .



Private Sub Command1_Click()
Set Printer = Printers(0)
TODAYSDATE = Date
Debug.Print daysago
Open "u:\compfold\SAVEDATA.TXT" For Input As #1
For x = 1 To 100
If EOF(1) Then GoTo gohere3
Input #1, TECHS(x)
Input #1, CUST(x)
Input #1, TIMEIN(x)
Input #1, TIMEOUT(x)
Input #1, TIMELEAVE(x)
Input #1, DATES(x)
Input #1, phone(x)
Next
gohere3: Close #1: HOWMANYFILESOPENED = x
For x = 1 To HOWMANYFILESOPENED
 If DATES(x) >= Text1.Text Then
  If DATES(x) <= Text2.Text Then
     Printer.Print TECHS$(x), CUST(x), , TIMEIN(x), , TIMEOUT(x), TIMELEAVE(x), DATES(x)
 End If
 End If
Next
Printer.NewPage
thismanydays:
 End Sub
Avatar of Brendt Hess
Brendt Hess
Flag of United States of America image

You neglected a Printer.EndDoc statement to tell it you were done.
Hi
 to make Date comparison I think U need to use date type vars or convert to

like
    Cdate(text1.text) instead of text1.text


also
dime dates() as date
Avatar of LuckyPhill
LuckyPhill

bhess1 you nailed it :)
ASKER CERTIFIED SOLUTION
Avatar of Brendt Hess
Brendt Hess
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
PRINTER.ENDDOC is bang on.

somebody already quoted this.

add that at the end and prestow,


cheers
andy

ps dont give me the points i was just reiterating
Thanks bhess1

I didn't have time to explain
but I think I would not explain it better

( if points R to be devided EndDoc , bhess1 ,... me)
thanks 4 all of U