Rabu, 28 September 2011

[MS_AccessPros] Re: Opening form so it has the focus

 

It's working! Question--is this the best way to set the modal property upon opening a form using vba?
Here's what I did:

DoCmd.OpenForm "Contacts"
Forms!Contacts.Modal = False
Forms!Contacts.SetFocus

--- In MS_Access_Professionals@yahoogroups.com, mrsgoudge <no_reply@...> wrote:
>
> Good morning! Or whatever it is where you are :-)
>
> Upon clicking a button on Main Menu, the Contacts form is supposed to open with the modal property changed to No. (Form Contacts' modal property is set to yes). When I use the code below the form opens but only its tab shows--Main Menu remains on top.
>
> Thanks!
> Connie
>
> On Error GoTo Proc_Err
> DoCmd.OpenForm "Contacts"
> Forms!Contacts.Modal = False
> DoCmd.GoToRecord , , acNewRec
>
>
> Proc_Exit:
> Exit Sub ' or Exit Function
> Proc_Err:
> MsgBox Err.Description, , _
> "ERROR " & Err.Number _
> & " btnContacts_Click"
> Resume Proc_Exit
> 'if you want to single-step code to find error, CTRL-Break at MsgBox
> 'then set this to be the next statement by right-clicking on Resume Statement, then press F8 to execute one line at a time
> Resume
>

__._,_.___
Recent Activity:
MARKETPLACE

Stay on top of your group activity without leaving the page you're on - Get the Yahoo! Toolbar now.

.

__,_._,___

Tidak ada komentar:

Posting Komentar