If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Printing current record
(Type your message here)
Could someone please help!! I am trying to print the current record on a form. i have used the following code in the private sub for a preview report button in one instance: DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70 DoCmd.OpenReport "NCR_Rpt", acViewPreview, , "[Serial Number]=" & Me.Serial_Number and it works fine automatically. I have tried to do exactly the same thing only changing the report name and corresponding fields on a different form eg: DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70 DoCmd.OpenReport "ECN_Rpt", acViewPreview, , "[ECN_ID]=" & Me.ECN_ID when i click on the button it asks me for the ECN_ID and even if i just click ok it does what i want but Does anyone know how to stop the prompt box from popping up or has anyone got a better code example? -------------------------------- From: David Cowdrey ----------------------- Posted by a user from AdminLife (http://www.adminlife.com/) IdFD7DH6lU9Em04KehHnHF2w==/Id |
#2
|
|||
|
|||
Printing current record
Hum...looks ok.
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70 DoCmd.OpenReport "ECN_Rpt", acViewPreview, , "[ECN_ID]=" & Me.ECN_ID The only thing to remember here is that [ECN_ID] is the name of the field in the report..and has NOTHING to do with your current form. So, I would check the report. The other thing to check is try launching the report from the report tab..and NOT use code...does it still prompt? If it does..then you likely have some control, or something else on the report that needs to be looking at. So, try launching the report from the report view tab..and see if any prompts occur. if they do..then you have to fix. And, then try your above code again. And, as mentoend, double check if the field [ECN_ID] is in the reprot. Good luck! -- Albert D. Kallal (Access MVP) Edmonton, Alberta Canada http://www.attcanada.net/~kallal.msn |
Thread Tools | |
Display Modes | |
|
|