set focus

virencm

Registered User.
Local time
Tomorrow, 02:02
Joined
Nov 13, 2009
Messages
61
i am trying to get the focus to change to another field as soon as a defect is recorded for a part. can some one please take a look at the code below and point me in the right direction..

thanks viren

If SCR = -1 Then

MsgBox " A DEFECT MUST BE RECORDED FOR THIS PART "
DoCmd.GoToControl "defects"
DoCmd.RunMacro "m_zoomBox"


MsgBox " PLEASE ORDER PART & LIST S/O & LINE # "

this is where i need the focus to move to a field called notes

DoCmd.RunMacro "m_zoomBox"
DoCmd.Save


Else



End If
 
It doesnt seem to work.

error says that it cannot set focus on notes.

regards
viren
 
you should avoid names that might be reserved names.

use the explicit format:
Forms![MainFormName]![SubFormName]![FieldName].SetFocus
 

Users who are viewing this thread

Back
Top Bottom