paddypowa 0 Newbie Poster

Hey,

Having a couple of issues with two seperate Cell Content Clicks, one shows an error of nothing being in row 0, I have checked and there definitely is, and the other just does nothing when I click on the cell contents.

Private Sub dtgTechLog_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs)
        ds.Clear()

        selectTech = dtgTechLog.CurrentRow.Cells(7).Value()
        strSQL = "SELECT * FROM Technician WHERE techUserName LIKE '" & selectTech & "'"
        Dim da As New OleDbDataAdapter(strSQL, conn)
        da.Fill(ds)

        txtTechIDLog.Text = ds.Tables(0).Rows(0).Item("technicianID").ToString()
        txtTechFirstNameLog.Text = ds.Tables(0).Rows(0).Item("firstName").ToString()
        txtTechSurnameLog.Text = ds.Tables(0).Rows(0).Item("surname").ToString()
        txtTechLocationLog.Text = ds.Tables(0).Rows(0).Item("location").ToString()
        txtJobAssignedLog.Text = ds.Tables(0).Rows(0).Item("jobAssigned").ToString()
        txtTechPasswordLog.Text = ds.Tables(0).Rows(0).Item("techPassword").ToString()
        txtSpecialisationLog.Text = ds.Tables(0).Rows(0).Item("specialisation").ToString()
        txtTechUserNameLog.Text = ds.Tables(0).Rows(0).Item("techUserName").ToString()

    End Sub

The above code is where nothing happens at all.

The below code is where it errors. I am using a MS Access DB btw for my datagrid.

Private Sub dtgUpdateJob_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles dtgUpdateJob.CellContentClick

        ds.Clear()

        selectJob = dtgUpdateJob.CurrentRow.Cells(5).Value()
        updSQL = "SELECT * FROM Jobs WHERE jobNumber LIKE '" & selectJob & "'"
        Dim da As New OleDbDataAdapter(updSQL, conn)
        da.Fill(ds)

        txtJobUpdateNumber.Text = ds.Tables(0).Rows(0).Item("jobNumber").ToString()
        txtFaultDesJobUpd.Text = ds.Tables(0).Rows(0).Item("faultDescription").ToString()
        txtTechJobUpd.Text = ds.Tables(0).Rows(0).Item("technicianAssigned").ToString()
        txtJobFixedUpd.Text = ds.Tables(0).Rows(0).Item("faultFixed").ToString()
        txtNonFaultUpd.Text = ds.Tables(0).Rows(0).Item("nonFaultJob").ToString()
        txtStaffRangUpd.Text = ds.Tables(0).Rows(0).Item("staffMemberRang").ToString()
    End Sub