Rabu, 26 November 2014

Re: [MS_AccessPros] Help with VBA

 

Private Sub Form_Close()

    ' Open the other form
    DoCmd.OpenForm "B"
    ' Put focus on form to force it to finish opening
    Forms!B.SetFocus
    ' Put focus on CERTAIN control
    Forms!B!CERTAIN.SetFocus
End Sub

No need to do the SetFocus on the second form if the control you want to have the focus is the first in the tab order on that form.

John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications 
SQL Queries for Mere Mortals 
(Paris, France)




On Nov 26, 2014, at 7:29 PM, kenaf42@yahoo.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:

I need a code for OnClose event of form "A", to open form "B" and set focus on CERTAIN field in form "B"



__._,_.___

Posted by: John Viescas <johnv@msn.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (2)

.

__,_._,___

Tidak ada komentar:

Posting Komentar