Advertisement
Guest User

Untitled

a guest
Sep 20th, 2019
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Public Class ShowAllUsers
  2.  
  3.     Dim intMaxRows As Integer
  4.     Dim intCounter As Integer
  5.     Sub AddRecordsToForm(ByVal strTable As String)
  6.  
  7.         intMaxRows = ds.Tables(strTable).Rows.Count
  8.  
  9.         'set up a loop to populate the list boxes with the fields of each record in the specified Access Database Table
  10.  
  11.         For intCounter = 0 To (intMaxRows - 1)
  12.  
  13.             lbx_users.Items.Add(ds.Tables(strTable).Rows(intCounter).Item(1))
  14.             lbx_levels.Items.Add(ds.Tables(strTable).Rows(intCounter).Item(2))
  15.             lbx_passwords.Items.Add(ds.Tables(strTable).Rows(intCounter).Item(3))
  16.  
  17.         Next
  18.  
  19.     End Sub
  20.  
  21.     Private Sub ShowAllUsers_Load(sender As Object, e As EventArgs) Handles MyBase.Load
  22.  
  23.         ConnectToDatabase("SELECT * FROM tblUSER", "tblUSER")
  24.         AddRecordsToForm("tblUSER")
  25.         intCounter = 0
  26.  
  27.     End Sub
  28.  
  29.     Private Sub ShowAllUsers_FormClosing(sender As Object, e As FormClosingEventArgs) Handles MyBase.FormClosing
  30.  
  31.         DisconnectFromDatabase()
  32.  
  33.     End Sub
  34.  
  35.     Private Sub Btn_ReturnToMenu_Click(sender As Object, e As EventArgs) Handles btn_ReturnToMenu.Click
  36.  
  37.         MainMenu.Show()
  38.         Me.Close()
  39.  
  40.     End Sub
  41. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement