Print Single Form

kostaskir

Registered User.
Local time
Today, 16:19
Joined
Jan 21, 2009
Messages
65
Hello everyone,

I have a simple form on Access 2007. I added an print button.
And when I press the button it prints all the records of the database.

Do you know guys what I have to do If I want to print only the current record. ?

I tried on the properties to change the "cycle" from "All Records" to "Current Records". But Is not working !

Any ideas ?

Thanx.
 
Now, Allan, you know the OP doesn't want to go to all the trouble of creating a report! :D

Allan's suggestion is the correct way of doing this; forms are meant to view and or enter/edit records, reports are meant to print records.

But I'm guessing you want to simply print the one record you have in front of you, just as it looks there in front of you. You'll need to add a command button to your form to do this, name it PrintSingleRecord, then place this code behind it:
Code:
Private Sub PrintSingleRecord_Click()
    If Me.Dirty Then Me.Dirty = False
    DoCmd.RunCommand acCmdSelectRecord
    DoCmd.PrintOut acSelection
End Sub
If this should happen to be a Datasheet View record, you'll need to place the same code in the DoubleClick event of one of the textboxes instead of on a command button; command button aren't allowed in that view.
 

Users who are viewing this thread

Back
Top Bottom