I have put this code in the Form_Load() event and when I debuged it it counted correct and the code worked fine, however when I get to the .PrintForm method it dos'nt print the row lines or column lines, but if I replace the .printform with frmPrint.Show they do appear.
I am making the .printform call from another form but I think i'm using it correctly as you can see from below.
any ideas?
VB Code:
Private Sub Form_Load() picWindow.Left = 0 picWindow.Width = Me.Width picI_Print.Left = 0 picI_Print.Width = picWindow.Width Dim i As Integer Dim t As Integer t = 2775 For i = 1 To 54 ' Add Line Numbers t = t + 225 ' to form picI_Print.CurrentX = 0 picI_Print.CurrentY = t picI_Print.Print i picI_Print.Line (0, t)-(picI_Print.Width, t) 'Make rows 225 twips apart Next '''' Make columns picI_Print.Line (300, 2400)-(300, picI_Print.Height) picI_Print.Line (750, 2400)-(750, picI_Print.Height) picI_Print.Line (2100, 2400)-(2100, picI_Print.Height) picI_Print.Line (3525, 2400)-(3525, picI_Print.Height) picI_Print.Line (4500, 2400)-(4500, picI_Print.Height) End Sub Private Sub Command4_Click() Me.Hide Load frmPrint frmPrint.PrintForm End Sub
Edit: Added [vbcode][/vbcode] tags for clarity. - Hack




Reply With Quote