Q: Using CurrentX and CurrentY with printing
I have a problem with the following code. I wish to print the contents of a recordset to the printer but it continues to ignore CurrentX, CurrentY commands, but prints OK to the form. Is there a flag to stop linefeeds ????

Mike Steur; master@vianet.net.au Private Sub Command1_Click() Dim CX, CY, I As Integer Dim wsTest As Workspace Dim dbTest As Database Dim rstest As Recordset Set wsTest = Workspaces(0) Set dbTest = wsTest.OpenDatabase("D:\itinery\1997.mdb") Set rstest = dbTest.OpenRecordset("itinery", dbOpenDynaset) rstest.MoveFirst DrawWidth = 1 CY = 1000 CurrentY = CY Do Until rstest.EOF CX = 1000 '***** PROBLEM ****** For I = 0 To rstest.Fields.Count - 1 ' VVVVV CurrentX = CX ' vvv CurrentY = CY ' V Print rstest.Fields(I).Value '*** THIS PRINTS OK ACROSS '*** THEN DOWN Printer.Print rstest.Fields(I).Value '*** THIS PRINT ONE FIELD AFTER '*** ANOTHER DOWN THE PAGE CX = CX + 1000 Next I '******* WHY ??? ******* rstest.MoveNext CY = CY + 200 Loop Printer.EndDoc End Sub
A: First question is on what scale you have set the printermode? You can change it (see the help for ScaleMode) and depending on the mode is also the value of CX & CY. For example if the scale is set to Printer.ScaleMode = vbMillimeters then 1000 is much to large to fit on a paper. Second after setting the scale you must set also the papersize: Printer.Scale (0, 0)-(210, 290) for an A4. Third (but I don't know it is neccesarry) you must the proper CurrentX & CurrentY: the printers CurrentX & CurrentY. So the code would look like: Private Sub Command1_Click() Dim CX, CY, I As Integer Dim wsTest As Workspace Dim dbTest As Database Dim rstest As Recordset Set wsTest = Workspaces(0) Set dbTest = wsTest.OpenDatabase("D:\itinery\1997.mdb") Set rstest = dbTest.OpenRecordset("itinery", dbOpenDynaset) rstest.MoveFirst Printer.ScaleMode = vbMillimeters Printer.Scale (0, 0)-(210, 290) CY = 10 Do Until rstest.EOF CX = 10 Printer.CurrentY = CY For I = 0 To rstest.Fields.Count - 1 Printer.CurrentX = CX Printer.Print rstest.Fields(I).Value CX = CX + 10 Next I rstest.MoveNext CY = CY + 20 Loop Printer.EndDoc End Sub Return