Rabu, 18 Mei 2011

Re: [MS_AccessPros] Gotocontrol not working

 

John,

Two questions:
I pasted your code in and it's still setting focus on the next field.

Where would I find info about direct methods. I'm guessing your book? Guess I'll have to bone up on it so that I recognize when there is a direct method. My mind is having a hard time holding onto all this info :-(

Thanks again for all your help,
Connie

--- In MS_Access_Professionals@yahoogroups.com, "John Viescas" <john@...> wrote:
>
> Connie-
>
> Never use DoCmd if there's a direct method. Use:
>
> Me.ListIDPropertyName.SetFocus
>
>
> 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, May 18, 2011 8:08 PM
> To: MS_Access_Professionals@yahoogroups.com
> Subject: [MS_AccessPros] Gotocontrol not working
>
> A form's combobox (ListIDPropertyName) has code for the AfterUpdate event. The
> gotocontrol portion is not working. My goal is to have the cursor be in the
> control (ListIDPropertyName) that the code is behind.
>
> If I use DoCmd.GoToControl Screen.PreviousControl.Name the cursor is in the
> control before ListIDPropertyName.
>
> If I use DoCmd.GoToControl Screen.ActiveControl.Name the cursor ends up in the
> control after ListIDPropertyName. (the next control in tab order)
>
> If I use DoCmd.GoToControl "ListIDPropertyName" the cursor ends up in the
> control after ListIDPropertyName. (the next control in tab order)
>
> Here's the code:
> If DCount("ListID", "Listings", "PropertyName = '" &
> Me.ListIDPropertyName.Column(2) & "'") > 1 Then
> MsgBox "There are several properties with this name--click the arrow to the
> right of the Property Name box to make sure you are selecting the correct one. "
> DoCmd.GoToControl Screen.ActiveControl.Name
> End If
>
> Thanks for helping!
> Connie
>
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>

__._,_.___
Recent Activity:
MARKETPLACE

Get great advice about dogs and cats. Visit the Dog & Cat Answers Center.


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

.

__,_._,___

Tidak ada komentar:

Posting Komentar