title: Autofill TextBox/Checkbox from a previous TextBox' value (VB.NET Database)
body: <p><em>Note: I'm using Visual Studio, original work was on SQL Server, moved to VB.NET</em></p>
  
  <p>I have a Textbox "ViewStatusTxt", next to it there's a Button "ViewStatusBtn"
  Below it there's a TextBox "ViewNAMETxt", another TextBox "ViewACTIVITYTxt" and then a Checkbox "ModifyStatusCB"</p>
  
  <p>I'm trying to auto-fill the Checkbox AND the Textbox based on the ID input there, however I really have no clue about it since I'm new to VB.NET </p>
  
  <p>Here's the code used</p>
  
  <pre><code>Private Sub IDSearch(StatusViewBtn As String)
      ' ADD SEARCH QUERY PARAMETERS - WITH WILDCARDS
      SQL.AddParam("@StatusViewBtn", StatusViewBtn)
  
      'RUN QUERY - SEARCH GIVES THOSE RESULTS
      SQL.ExecQuery(" SELECT
                          aID,
                          Name,
                          Status,
                          Activity
  
                      FROM
                          [dbo].[initialTable]
  
                      WHERE
                          aID = @StatusViewBtn
  
                      ORDER BY
                          aID ASC")
  End Sub
  </code></pre>
  
  <p>That's the function's code, which is fully working since it's a smaller version of the same one I used in a Search Page</p>
  
  <p>Here's the button's function, which I'm sure is where I'm having problems, unless I need to add a specific function to the ViewNAMETxt</p>
  
  <pre><code>Private Sub StatusViewBtn_Click(sender As Object, e As EventArgs) Handles StatusViewBtn.Click
      IDSearch(StatusViewBtn.Text)
      ViewNAMETxt.Text = SQL.ExecQuery("SELECT
                                              Name
                                          FROM
                                              initialTable
                                          WHERE
                                              aID = @StatusViewBtn")
  End Sub
  </code></pre>
  
  <p>And I haven't even started on the Checkbox, viewing how the first one caused me issues. Hopefully the solution would be similar to both of them.
  Thanks for reading guys, and sorry for the newbie question</p>