I need help with synch 2 forms

  • Thread starter Thread starter Al
  • Start date Start date
A

Al

I have two forms that are exactly similar both have tabbed pages. Let us say
that they are From1 and Form2. I want to open From2 from Form1 and set focus
on the same control that has the focus in Form1. Is there a way?
thanks
 
Thank you Marshall,
Only one problem using the ".ActiveControl" is that when I open Form2 I open
it from Form1 by clicking a command button called "cmdAudit", hence, the
command button will always have the focus, therefore I get an error message
saying that It can not find cmdAudit control on Form2 and this is due to the
fact that I do not have this control on Form2. Because of that,
".ActiveControl" is going to be a problem. That is why this is tricky. The
user wants to be working, say, in text boxe on tab "Page3" and when they
click on the cmdAudit button they want Form2 to open on tab Page3 and so on.
Do you think that is possible?
thanks
 
Yes, it works, thank you

Marshall Barton said:
You could try using Screen.PreviousControl instead of
Me.ActiveControl

OTOH, I sometimes use the DoubleClick event on individual
controls instead of a separate button. There's slightly
less UI clutter and it doesn't move the focus.
--
Marsh
MVP [MS Access]

Only one problem using the ".ActiveControl" is that when I open Form2 I open
it from Form1 by clicking a command button called "cmdAudit", hence, the
command button will always have the focus, therefore I get an error message
saying that It can not find cmdAudit control on Form2 and this is due to the
fact that I do not have this control on Form2. Because of that,
".ActiveControl" is going to be a problem. That is why this is tricky. The
user wants to be working, say, in text boxe on tab "Page3" and when they
click on the cmdAudit button they want Form2 to open on tab Page3 and so on.
Do you think that is possible?
thanks
 
Back
Top