Firstly, forget VB6 it is long dead. Get yourself a copy of
Download Visual Studio 2019 for Windows & Mac[
^] Community Edition, which is free. You can then start working on VB.NET which is the up to date and supported Visual Basic.
Secondly, when you extract some data from a field that is supposed to be filled in by the user, the first thing you must always do is validate it. Check it is not blank, it is in the correct format, it has valid characters etc. Do not assume that the user is as smart as you.