cyberal
Nov 11 2010, 04:37 PM
I have form1 opening form2. On form 2, I enter some data. When I'm done on form2, I want form2 to stay open but set the focus back to form1. When I'm done using form2, I will then close form2. On form2, I have a button that simply tries to set the focus back to form1 using forms!form1!setfocus and I have tried setting focus to a control on form1 using forms!form1!mybutton!setfocus but neither is working so I know I am doing something wrong. Can anybody help me with the syntax?
Thanks in advance
Cyberal
theDBguy
Nov 11 2010, 04:43 PM
Hi,
What is the code you're using to open form2 from form1? By any chance are you using the acDialog argument?
cyberal
Nov 11 2010, 04:51 PM
I am using .... DoCmd.OpenForm "form4", acNormal
theDBguy
Nov 11 2010, 04:53 PM
Hi,
I see. So, if this is your actual syntax:
Forms!form1!SetFocus
then try replacing the bang with a dot:
Forms!form1.SetFocus
Hope that helps...
cyberal
Nov 11 2010, 05:36 PM
theDBguy,
As usual, you come through again! I just needed to shake the leaves out of the trees a little.
Thanks again
theDBguy
Nov 11 2010, 05:41 PM
Hi cyberal,

Glad to hear it worked out for you. Good luck with your project.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.