问题
I have a problem with a function where it is causing a "RunTime error 2449, There is an invalid method in an expression" on the frm.setfocus line. The form being referred to is a subform, please can anyone help with this error?
The function is:
Function NewItemsSaveAfter(frm As Form)
If frm.Parent.PartSaveYesNo = "Yes" Then
varCurrRec = frm.CurrentRecord
frm.Parent.Form.Refresh
frm.SetFocus
DoCmd.GoToRecord , , acGoTo, varCurrRec
Else
End If
End Function
回答1:
Set the focus to the child control containing the subform.
来源:https://stackoverflow.com/questions/23384037/module-function-frm-setfocus-runtime-2449-error