Setfocus & Me

natsirtm

Registered User.
Local time
Today, 14:52
Joined
Apr 30, 2007
Messages
57
If i setfocus to a subform, does Me refer to the focused subform, or does it still refer to the main form?

eg.
Code:
If Me.Dirty Then [COLOR="Green"]'Here, Me refers to the form[/COLOR]
    Me.Scores.SetFocus
    If Me.Dirty Then [COLOR="green"]' Here, does Me refer to the form or subform?[/COLOR]
        DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70
    End If
    Forms!Audits.Form.SetFocus
    DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70
    DoCmd.close
End If

thanks
 
Which form is the code in, what is Scores? Scrap the do menu item anyway, it's obsolete, replace it with Me.Undo
 
The code was in the Audits form. Scores is the name of the subform.
It doesn't matter anymore as I realized as soon as you move focus, you can't undo anymore, so I just created an undo button for the subform.

Thanks for the me.undo tip.
 

Users who are viewing this thread

Back
Top Bottom