The Focus method moves the focus to a field.
field.Focus([setvalue])
• field – A window field object.
• setvalue – The value you can set for the field gaining focus.
Use the Focus method to skip unnecessary fields in a window, or place the focus in a specific field based upon a user entry. The Microsoft Dynamics GP got focus event and the VBA BeforeGotFocus and AfterGotFocus events occur when you move the focus to a field using the Focus method.
You cannot place the focus using a window’s BeforeOpen or AfterOpen event. By default, Microsoft Dynamics GP places the focus in the first field in the tab sequence after these events occur.