View Full Version : set focus to subform control


cliff7376
05-16-2002, 08:12 AM
I have a main form (frmshipment)that when i open it i would like to have the cursor in one of my subform(fselshipment1) fields called txtSalesOrderID. i tried one of the solutions but it didn't work my code was this

Me.Child119.Form.txtSalesOrderID.SetFocus

can anyone help me. thank you

Raza
05-16-2002, 08:35 AM
try

forms![formname]![subformname]![fieldname].setfocus

in your onload event for your form

didnt test it. might work though http://www.access-programmers.co.uk/ubb/wink.gif

lemme know if it doesnt

Jerry Stoner
05-16-2002, 09:06 AM
[Forms]![FormName].[SubFormName].[Form].[ControlName].SetFocus

You may have to set focus to the subform then the control:

[Forms]![FormName].[SubFormName].SetFocus
[Forms]![FormName].[SubFormName].[Form].[ControlName].SetFocus