Rabu, 18 Mei 2011

[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

__._,_.___
Recent Activity:
.

__,_._,___

Tidak ada komentar:

Posting Komentar