Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports System.Data.OleDb
- Public Class FrmEvents
- Private Sub FrmEvents_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- 'this will pull up all of the values from the table tblEvents and laod them into a table in dgvEvents
- SQL = "SELECT * FROM TblEvents;"
- Cmd = New OleDbCommand(SQL, Con)
- Dim SQLResults As DataTable = PerformCRUD(Cmd)
- dgvEvents.DataSource = SQLResults
- End Sub
- Private Sub dgvEvents_CellClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles dgvEvents.CellClick
- Dim thisrow As Integer = e.RowIndex
- 'when a cell is clicked all of the data for that record wil be loaded into the text boxes on the form
- cmbEventID.Text = dgvEvents.Item(0, thisrow).Value
- txtAgeGroup.Text = dgvEvents.Item(1, thisrow).Value
- txtEventType.Text = dgvEvents.Item(2, thisrow).Value
- txtGender.Text = dgvEvents.Item(3, thisrow).Value
- txtTrackField.Text = dgvEvents.Item(3, thisrow).Value
- End Sub
- Private Sub btnback_Click(sender As Object, e As EventArgs) Handles btnback.Click
- frmAdmin.Show()
- Me.Hide()
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement