Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / July 2007

Tip: Looking for answers? Try searching our database.

print a record in form view

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
event procedure for a click event - 03 Jul 2007 19:40 GMT
I am building a form and have inserted an event procedure to have the form
print one record at a time and it will only print a blank piece of paper.  
This is my code, can anyone tell me what they think is wrong?  Any help is
greatly appreciated.

rivate Sub cmdPrint_Click()
On Error GoTo Err_cmdPrint_Click

   DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
   DoCmd.PrintOut acSelection

Exit_cmdPrint_Click:
   Exit Sub

Err_cmdPrint_Click:
   MsgBox Err.Description
   Resume Exit_cmdPrint_Click
   
End Sub
missinglinq - 03 Jul 2007 23:20 GMT
Assuming that the line

rivate Sub cmdPrint_Click()

is only missing the *P* in Private because of a copying mistake, and the
actual code reads

Private Sub cmdPrint_Click()

I don't know! The code works fine for me, regardless of the type of form used,
unless the record with focus was blank. What type of form are you using?
Single View, Continuous or Datasheet?

Signature

There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000

event procedure for a click event - 04 Jul 2007 11:10 GMT
Thank you and you're right, it was just a copying mistake.  I had created a
different database and this was the code I used in that one to actually have
a copy of the form print out.  When I inserted this code into my new database
form it just prints a blank sheet of paper.  I did add test data and it did
print the actual record but not the form it was in (meaning no lables - it
was just a bunch of Xs and comments on a blank piece of paper that made no
sense).  I'm having a hard time figuring out why it would print a blank form
in one database and a blank sheet of paper in another database.  Thank you
for your help, though, it's appreciated.

> Assuming that the line
>
[quoted text clipped - 8 lines]
> unless the record with focus was blank. What type of form are you using?
> Single View, Continuous or Datasheet?
Daniel - 03 Jul 2007 23:26 GMT
For various reasons you should create a report and then printout the desired
record.  For more info on this look at http://allenbrowne.com/casu-15.html
Signature

Hope this helps,

Daniel P

> I am building a form and have inserted an event procedure to have the form
> print one record at a time and it will only print a blank piece of paper.  
[quoted text clipped - 15 lines]
>    
> End Sub
event procedure for a click event - 04 Jul 2007 11:12 GMT
I will try this!  Thank you.

> For various reasons you should create a report and then printout the desired
> record.  For more info on this look at http://allenbrowne.com/casu-15.html
[quoted text clipped - 18 lines]
> >    
> > End Sub
event procedure for a click event - 06 Jul 2007 00:30 GMT
I just want everyone to know I FINALLY found my error.  In the page setup
feature I had the box to print data only checked.  After I unchecked it, my
form printed by the code shown below.  Thanks for all your help.

> I will try this!  Thank you.
>
[quoted text clipped - 20 lines]
> > >    
> > > End Sub
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.