want 1 page to print

JulieFall

New member
Local time
Today, 02:17
Joined
Dec 12, 2002
Messages
7
I have created an "autonumber" form and a report. Added a print report button and only want the current form to print not all of them. Seems simple......

Thanks
 
I guess I forgot to mention that I was clueless.

Don't know where to add that. :confused:
 
Sorry for assumming...

If you look at the button's Event on the properties sheet. OnClick should have an expression in it. Click on the far right of the OnClick event. There should be code to open your report. (ie. Docmd.Open...)

There should also be a command to print the report. Put "acSelection" behind that command as follows...

Docmd.Printout acSelection

HTH
 
Hi Casey....

Thanks.... though this is the statement that was already in:

Private Sub Print_Click()
On Error GoTo Err_Print_Click


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

Exit_Print_Click:
Exit Sub

Err_Print_Click:
MsgBox Err.Description
Resume Exit_Print_Click

End Sub

how should I change this?
 
Casey.......

I just got doing this.

Write a query something similiar to this....



SELECT Inventory.*
FROM Inventory
WHERE [FORMS]![INVENTORY_FORM]![AUTO_NUMBER]=INVENTORY.AUTO_NUMBER;
------------------------------------------------------------------
* Selects everything

[INVENTORY_FORM] will be the name of the form that you are using.

[AUTO_NUMBER] is the auto_number field.

2. Create your Report

3. Create a Macro that the action is "Open Report" (you'll see if you are not familiar with this.)

4. Now on your form put a button that runs your Macro that you just created.

Good luck.

Kacy
________
Tits And Ass
 
Last edited:
Put this behind the on click - event procedure -

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "report name"

stLinkCriteria = "[label of autonumber]=" & Me![label of autonumber]
DoCmd.OpenReport stDocName, , , stLinkCriteria

This prints the current page only!! Good luck!
 

Users who are viewing this thread

Back
Top Bottom