How to set focus back on a form (1 Viewer)

chrisjames25

Registered User.
Local time
Today, 05:07
Joined
Dec 1, 2014
Messages
401
Hi I have the following save button in a form. When i click on it the idea is to resetdata and move to next record. THis all wokred perfectly but then i wanted to add in a report to print out when i click the button so that the boss at work can check the inputs rather than have to access the database (he likes paper)

Code:
DoCmd.RunCommand acCmdRecordsGoToNext

DoCmd.OpenReport "Rpt_InvoiceChecker"

ResetData
Me.Cbo_Customer.SetFocus
End Sub

WIthout the following code

Code:
DoCmd.OpenReport "Rpt_InvoiceChecker"
End Sub

It worked fine but now the form loses focus and i cant figure out how to get the focus back on the form.

Cheers
 

Ranman256

Well-known member
Local time
Today, 00:07
Joined
Apr 9, 2015
Messages
4,339
tell yr boss to enter the 21st century and stop killing trees.
you can produce a pdf, 'a digital paper'.

the openReport should never leave the form....it sends it to the printer.
recall the open form w: docmd.openform "myform"

you can create pdf for him/her
docmd.OutputTo acOutputReport ,vRpt,acFormatPDF,vFile

or email:
docmd.SendObject acSendReport ,"rMyReport",acFormatPDF,sTo,,,sSubj,sBody
 

chrisjames25

Registered User.
Local time
Today, 05:07
Joined
Dec 1, 2014
Messages
401
Hi Ranman

Thanks for the help. THat worked a treat. I have tried introducing this guy to the 21st century numerous times to no avail. For my records though the pdf thing will be great.
 

Users who are viewing this thread

Top Bottom