There are plenty of options, from the most basic to more sophisticated setups. As a beginner, you will want something down the middle, like a simple program that you can install and it will allow you to code small applications and hit a "play" button to compile-and-run your code. What fits best to that description is CodeBlocks, and make sure the download the version that has "MinGW" (which is the compiler, because technically-speaking, CodeBlocks is just the IDE software (IDE: Integrated Development Environment)).
On the more minimalistic side, you can simply install MinGW alone and learn to use it through the command-line (via MSYS or cmd.exe, or PowerShell). Then, you can edit the code itself with either a light-weight IDE like CodeLite or Geany, an enhanced text editor like Notepad++, emacs, or vim, or even with a plain text editor like Notepad. You'd be surprised how many experienced programmers use this kind of lean setup (command-line compiler + build scripts + enhanced text editor).
On the more sophisticated side, especially if you plan to do GUI programming, then you probably want to go for a heavier option. You can get Microsoft's Visual Studio Express editions for free, which is fully-featured for all practical purposes (missing / reduced features are things a beginner wouldn't need anyways). However, Visual Studio has a steep learning curve and its GUI programming facilities are pretty bad. For GUI programming specifically, I recommend using QtCreator, which is a pretty good IDE with a great GUI toolset, and fairly light-weight too.
Btw, all things that I have mentioned above are available for free (legally). The things that don't come for free are more on the higher-end, like complete editions of Visual Studio (retailing in the 500$ to 1000$ range, and several thousands for corporate licenses), and Intel development tools (IDEs and compilers) (retailing in the few thousands per individual tool). These higher-end products are rarely needed except in very high-end applications.
Dim Adapter As New OleDbDataAdapter
Dim Command As New OleDbCommand
Dim xFrom As String = dtpFrom.Value.ToString.Substring(0, dtpFrom.Value.ToString.IndexOf(" "))
Dim xTo As String = dtpTo.Value.ToString.Substring(0, dtpTo.Value.ToString.IndexOf(" "))
sqlQuery = MainQuery ...