Basically, it is just a matter of first, make sure the sender is a button type, then cast sender as a button, then you have the originating button at your disposal.
Looking for something like this ?
private void button1_Click(object sender, EventArgs e)
if (sender is Button)
Button btn = (Button)sender;
MessageBox.Show(btn.Name + " pressed");
btn.Text = "MeHo";
if (btn == button2) // something special if it was from button2
btn.Text += "-2";
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 ...