The error is generated by a Before record change event on MainForm calling Sub S_insert_url_to_Button. So when the form was first opened and before the first data was loaded, the event occurs and generates the error because nothing is loaded yet. If this event is removed, the error goes away. However, since I don't know why this event was placed there it is not known what other circumstances it affects. The error does not affect further processing.