J
Jess
I have a main form called Mainform with a subform called Subform (container
name: SubformContainerName). I am trying to add a new record to Subform from
another form (FormX, not related to MainForm) by using the following
statement:
‘Code in FormX. FormX is not a subform of Mainform
Forms!MainForm!SubformContainerName.SetFocus
Forms!MainForm!SubformContainerName.Form!SubformField.SetFocus
RunCommand acCmdRecordsGoToNew ‘this line triggers error ‘2046’
error ‘2046’: acCmdRecordsGoToNew isn’t available now
I have also tried the below statement of code, which also triggers error
424:’ Object Required’
‘Code in FormX. FormX is not a subform of Mainform
Forms!MainForm!SubformContainerName.Form.RecordSource.AddNew ‘this line
triggers error 424
Why is Access triggering the above errors? What am I missing here?
Thanks
name: SubformContainerName). I am trying to add a new record to Subform from
another form (FormX, not related to MainForm) by using the following
statement:
‘Code in FormX. FormX is not a subform of Mainform
Forms!MainForm!SubformContainerName.SetFocus
Forms!MainForm!SubformContainerName.Form!SubformField.SetFocus
RunCommand acCmdRecordsGoToNew ‘this line triggers error ‘2046’
error ‘2046’: acCmdRecordsGoToNew isn’t available now
I have also tried the below statement of code, which also triggers error
424:’ Object Required’
‘Code in FormX. FormX is not a subform of Mainform
Forms!MainForm!SubformContainerName.Form.RecordSource.AddNew ‘this line
triggers error 424
Why is Access triggering the above errors? What am I missing here?
Thanks