Rabu, 18 Mei 2011

RE: [MS_AccessPros] Gotocontrol not working

 

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

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


Find useful articles and helpful tips on living with Fibromyalgia. Visit the Fibromyalgia Zone today!

.

__,_._,___

Tidak ada komentar:

Posting Komentar