Lost forms focus after printing report with command control (1 Viewer)

drp

Registered User.
Local time
Today, 15:11
Joined
Dec 4, 2010
Messages
16
Hello,

i have a form with several controls, When i print a report using a command button on form the whole form lost focus also all other controls also lost focus. To focus on form I have to click on form, that i don't want. I want to autofocus form after printing report.

pls Help me I wating someones immediate response.....
 

vbaInet

AWF VIP
Local time
Today, 23:11
Joined
Jan 22, 2010
Messages
26,374
Well if you open a report the report will get the focus. When you close the report the previous object (which would be your form) should receive focus.

In any case here are some methods you may want to investigate:

Forms("NameOfForm").SetFocus

Or

DoCmd.SelectObject
 

missinglinq

AWF VIP
Local time
Today, 18:11
Joined
Jun 20, 2003
Messages
6,420
In point of fact the button used to initiate printing the report should have focus when the report closes.

Exactly what code are you using behind the button?
 

drp

Registered User.
Local time
Today, 15:11
Joined
Dec 4, 2010
Messages
16
it works, but in preview mode report does not pop up. it open in preview mode but goes behind the form and the form get focus. I want to focus a form when i close the report
hope you may understand my problem
thanks
 

missinglinq

AWF VIP
Local time
Today, 18:11
Joined
Jun 20, 2003
Messages
6,420
That's entirely different from your problem as originally stated!

Your form either has the Popup Property set to Yes or is opened from another form with the WindowMode set to acDialog, which sets the Popup Property to Yes. Correct this and the report preview will open in front of the form.
 

Users who are viewing this thread

Top Bottom