Dan Waters
dwaters at usinternet.com
Thu Apr 10 18:33:22 CDT 2008
Ed, I would use an Access report instead of an Access form. Have you tried arranging the textboxes you need in a report? Once you've got that, then you can open the form in preview mode, and print the report directly to the printer. The report will need to have a recordsource which contains the data which will fill the textboxes in the report. Does this sound familiar? Dan -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Edward S Zuris Sent: Thursday, April 10, 2008 6:36 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Printing on preprinted medical forms Hello Dan, Thanks for your response. The printer is an HP LasetJet 1020. It is working fine, the preprinted paper comes from local graphics shops following government specifications. I have already calculated where all the X and Y coordinates need to go. I suppose one could modify the following code to do something like you suggest, but said is a clumsy to use. Having a VBA program jump between design and print/view modes has a lot of moving parts that can break down. I could do a Ms-Word object from MsAccess, but there I run into the problem that the downward spacing needs to be 240 twips while the horizontal spacing needs to be 144 twips. Ms Word 2000 seems to drift when you get lower, further, into the document. I was wondering if there any ideas on avoiding this kind of activity ? Thanks. Sincerely, Ed Zuris. = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = Some quick and dirty code I did for a client to generate forms following a database. It works, but is slow. . . . = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = ' ******************************************** ' ******************************************** ' Where the changes happen ' DoCmd.OpenForm "frm504_Work", acDesign, "", "", acFormPropertySettings, acWindowNormal Set zzForm = [Forms]![frm504_Work] lCtrlType = 0 lCtrlType = acTextBox ' ******************************************** ' ******************************************** ' Data Control ' If [Forms]![frm500ViewBoss]("frmDataType").Value = 2 Then lCtrlType = acCheckBox dsWidth = 0.15 End If ' ******************************************** ' @Data and @Table Control sTable ' sBound = "" sBound = sTable & "." & sField Set ScrCtrl = CreateControl(zzForm.Name, lCtrlType, acDetail, "", sBound) ScrCtrl.Locked = True ScrCtrl.Top = dsTop * 1440 ScrCtrl.Left = dsLeft * 1440 ScrCtrl.Width = dsWidth * 1440 ScrCtrl.Height = 0.1667 * 1440 ' ******************************************** ' ControlTipText ' ScrCtrl.ControlTipText = " " & sBound & " " sTmp7 = "" sTmp7 = Trim$(ScrCtrl.Name & " ") sTmp7 = "txt" & zRemove(sTmp7, "Text") ScrCtrl.Name = sTmp7 ' ******************************************** ' ******************************************** ' Make a label ' If [Forms]![frm500ViewBoss]("chkLabel").Value = True Then dsLeftL = dsLeft dsNextL = dsNext dsWidthL = dsWidth dsTopL = dsTop - 0.1674 If dsTopL < 0# Then dsTopL = 0# End If If dsLeftL < 0# Then dsLeftL = 0# End If If dsWidthL < 0# Then dsWidthL = 0# End If sTmp6 = "" sTmp6 = "=" & Chr$(34) & sField & Chr$(34) Set ScrLabel = CreateControl(zzForm.Name, acTextBox, acDetail, "", sTmp6) ScrLabel.Top = dsTopL * 1440 ScrLabel.Left = dsLeftL * 1440 ScrLabel.Width = dsWidthL * 1440 ScrLabel.Height = 0.15 * 1440 ScrLabel.SpecialEffect = 0 ScrLabel.BackColor = 12963027 ScrLabel.BackStyle = 1 ScrLabel.FontUnderline = True sTmp7 = "" sTmp7 = Trim$(ScrLabel.Name & " ") sTmp7 = "lbl" & zRemove(sTmp7, "Text") ScrLabel.Name = sTmp7 End If = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com]On Behalf Of Dan Waters Sent: Thursday, April 10, 2008 12:07 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Printing on preprinted medical forms Hi Ed, Glad you could join this list! Actually, what you're describing should be fairly easy. All you'll need to do is set up the report fields to match the locations on the CMS form. Because you can move those fields around with your mouse, getting them to print in the location you want doesn't require the use of XY coordinates or a data buffer. If your printer is using a special ink, then a question is, "Does this printer have a Windows printer driver?" If so, then you should be able to set up this report pretty easily. Best of Luck, Dan -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Edward S Zuris Sent: Thursday, April 10, 2008 2:23 PM To: accessd at databaseadvisors.com Subject: [AccessD] Printing on preprinted medical forms Hello Everyone, I joined this mail list service just yesterday. I am starting a project to fill in special preprinted forms, called CMS-1500 forms. Those forms uses a special red ink that helps with the scanners which process the preprinted forms filled in by various clients. My effort is to try to help one of the end user clients with the filling in the of the CMS-1500 forms. With the added benefit of keeping track of what has been sent in. It would be helpful to work in twips to allow for fine tuning and adjusting to insure printing occurs within the little preprinted boxes. Is it possible to create a function that be can supplied with X Y coordinates along with the data that will be placed into a buffer, or something that emulates a buffer? Then once the buffer, or emulated buffer, is deemed complete, can the results then be sent to the default printer loaded with the preprinted forms for printing ? Sounds simple, but implementing it isn't. How would some approach this challenge using Microsoft Access 2000 VBA ? Thanks, Sincerely, Ed Zuris -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com