Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Gotocontrol error 1

Status
Not open for further replies.

byfr7

Technical User
Oct 1, 2003
8
US
I tried to show the Activity Name auto when I select the Category Name(Party,Conference, other...) from my combo box and this part works good. However, after selecting the Category name, I would like it auto point the next place where to enter the data. I use GoToControl function but it didn't work. I really don't know what is wrong with my code, please help!!!

Below is the code I use:
-----------------------------------------------

Private Sub ActivityDetailID_AfterUpdate()
On Error GoTo ActivityDetailID_AfterUpdate_Err

Forms!Activity!ActivityName = DLookup("[ActivityName]", "ActivityDetail", "[ActivityDetailID] = " & Forms!Activity!ActivityDetailID)
If (ActivityDetailID = "Party") Then
DoCmd.GoToControl "PartyType"
End If
If (ActivityDetailID = "Conference") Then
DoCmd.GoToControl "ConferenceDate"
End If
If (ActivityDetailID = "Others") Then
DoCmd.GoToControl "Momo"
End If

ActivityDetailID_AfterUpdate_Exit:
Exit Sub
---------------------------------------------------------

Thanks,
byfr
 
Have you tried the SetFocus method ?

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Thanks PHV, I tried what you suggested but still didn't work properly!!!
 
Are PartyType, ConferenceDate and Momo controls in the same form as ActivityDetailID ?

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Yes, they are all in the same form as ActivityDetailID.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top