I have seen loads of posts in regards to Error 2105 “You can't go to the specified record.” And have tried the workaround setting the focus on the subform and then the control on the subform but I am still stuck and really struggling to find a solution.
The issue in question is a report which has a sub form and attempting to paste an image and subsequently create new images so they are all displayed on the one report.
The original code in the report is,
Forms![Temp_Image_View]![SIGNATURE].SourceDoc = IMASOURCEDOC
Forms![Temp_Image_View]![SIGNATURE].Action = OLE_CREATE_EMBED
Forms![Temp_Image_View]![SIGNATURE].SetFocus
DoCmd.GoToRecord A_FORM, "Temp_Image_View", acNewRec
DoCmd.GoToRecord A_FORM, "Temp_Image_View", acPrevious, 1
It fails on the first “DoCmd.GoToRecord” with the error 2105 - “You can't go to the specified record.”. As stated I have looked at a number of forums and tried the following but it still complains,
Forms![Temp_Image_View]![SIGNATURE].SourceDoc = IMASOURCEDOC
Forms![Temp_Image_View]![SIGNATURE].Action = OLE_CREATE_EMBED
Forms![Temp_Image_View].SetFocus
Forms![Temp_Image_View].Form![SIGNATURE].SetFocus
DoCmd.GoToRecord A_FORM, "Temp_Image_View", acNewRec
DoCmd.GoToRecord A_FORM, "Temp_Image_View", acPrevious, 1
The AllowAdditions property on the subform is set to Yes. The example report brings back 3 signature images. This code works on the first run but fails when trying the second and third cycle of adding the image i.e. creating a new record on the subform.
Any help would be greatly appreciated.
N.B. Please note this database was originally written in Access 2.0, I am in the process of converting it to Access 2000.
The issue in question is a report which has a sub form and attempting to paste an image and subsequently create new images so they are all displayed on the one report.
The original code in the report is,
Forms![Temp_Image_View]![SIGNATURE].SourceDoc = IMASOURCEDOC
Forms![Temp_Image_View]![SIGNATURE].Action = OLE_CREATE_EMBED
Forms![Temp_Image_View]![SIGNATURE].SetFocus
DoCmd.GoToRecord A_FORM, "Temp_Image_View", acNewRec
DoCmd.GoToRecord A_FORM, "Temp_Image_View", acPrevious, 1
It fails on the first “DoCmd.GoToRecord” with the error 2105 - “You can't go to the specified record.”. As stated I have looked at a number of forums and tried the following but it still complains,
Forms![Temp_Image_View]![SIGNATURE].SourceDoc = IMASOURCEDOC
Forms![Temp_Image_View]![SIGNATURE].Action = OLE_CREATE_EMBED
Forms![Temp_Image_View].SetFocus
Forms![Temp_Image_View].Form![SIGNATURE].SetFocus
DoCmd.GoToRecord A_FORM, "Temp_Image_View", acNewRec
DoCmd.GoToRecord A_FORM, "Temp_Image_View", acPrevious, 1
The AllowAdditions property on the subform is set to Yes. The example report brings back 3 signature images. This code works on the first run but fails when trying the second and third cycle of adding the image i.e. creating a new record on the subform.
Any help would be greatly appreciated.
N.B. Please note this database was originally written in Access 2.0, I am in the process of converting it to Access 2000.