Rabu, 28 September 2011

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

 

Connie-

You could try opening the form hidden (WindowMode:=acHidden -- I think), set
the property, then set Forms!Contacts.Visible = True

John Viescas, author
Microsoft Office Access 2010 Inside Out
Microsoft Office Access 2007 Inside Out
Building Microsoft Access Applications
Microsoft Office Access 2003 Inside Out
SQL Queries for Mere Mortals
http://www.viescas.com/
(Paris, France)

-----Original Message-----
From: MS_Access_Professionals@yahoogroups.com
[mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of mrsgoudge
Sent: Wednesday, September 28, 2011 6:15 PM
To: MS_Access_Professionals@yahoogroups.com
Subject: [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
>

------------------------------------

Yahoo! Groups Links

__._,_.___
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