Hi
I have studied the results of my search for setting focus on a sub form and followed the suggestions. In the code below after opening the form "frmTechAssesSub" containing the subform "frmJobSheetNo9EditSub" and closing the calling form I want to set the focus on the "firstname" in the sub form. This is ignored and the focus remains on the first field in the main form.
However using the same instructions I can use msgbox to display correctly the contents of "FirstName" in the instruction following.
What am I doing wrong?
' Open Clients filtered on the current row
DoCmd.OpenForm FormName:="frmTechAssesSub", WhereCondition:=strFilter
' Close me
DoCmd.Close acForm, Me.Name
Forms!frmTechAssesSub!frmJobSheetNo9EditSub.Form.FirstName.SetFocus
MsgBox " first name " & Forms!frmTechAssesSub!frmJobSheetNo9EditSub.Form.FirstName
Exit Sub
I have studied the results of my search for setting focus on a sub form and followed the suggestions. In the code below after opening the form "frmTechAssesSub" containing the subform "frmJobSheetNo9EditSub" and closing the calling form I want to set the focus on the "firstname" in the sub form. This is ignored and the focus remains on the first field in the main form.
However using the same instructions I can use msgbox to display correctly the contents of "FirstName" in the instruction following.
What am I doing wrong?
' Open Clients filtered on the current row
DoCmd.OpenForm FormName:="frmTechAssesSub", WhereCondition:=strFilter
' Close me
DoCmd.Close acForm, Me.Name
Forms!frmTechAssesSub!frmJobSheetNo9EditSub.Form.FirstName.SetFocus
MsgBox " first name " & Forms!frmTechAssesSub!frmJobSheetNo9EditSub.Form.FirstName
Exit Sub