that is because you haven't declared it (the second issue) ie.I added option explicit, the error below shows now when the form is opened.
dim DeleteRecords as string
edit: I strongly recommend you ensure Option Explicit is at the top of all modules, including form modules. Once you have done that from the vba window select debug>compile. This will highly most potential problems in your code. If compile is greyed out, it means the code is successfully compiled. It is always worth compiling after making changes and before you execute the code to make sure these problems do not exist. It won't identify issues around data (such as null values, number out of range, etc) but you will have significantly reduced the number of potential issues you might get at runtime.
You can ensure new modules have Option Explicit added automatically when they are created by selecting Tools>Options and in the editor tab tick the 'require variable declaration' option