Private Sub cmdAdd_Click() If txtName.Text = "" Then MsgBox "Enter student name", vbExclamation Exit Sub End If With rsStudents .AddNew !RollNo = txtRollNo.Text !StudentName = txtName.Text !Marks = txtMarks.Text .Update End With
Public Sub CheckLowStock() Dim rs As New ADODB.Recordset rs.Open "SELECT ProductName, Quantity FROM products WHERE Quantity < ReorderLevel", conn, adOpenForwardOnly, adLockReadOnly If Not rs.EOF Then Dim msg As String msg = "The following products are running low:" & vbCrLf Do While Not rs.EOF msg = msg & rs!ProductName & " (Stock: " & rs!Quantity & ")" & vbCrLf rs.MoveNext Loop MsgBox msg, vbExclamation, "Inventory Alert" End If End Sub visual basic 6.0 projects with source code
' Requires: Microsoft Windows Media Player component (MSCOMCTL.OCX) Private Sub lstPlaylist_Click() If lstPlaylist.ListIndex >= 0 Then wmpPlayer.URL = lstPlaylist.List(lstPlaylist.ListIndex) lblCurrentlyPlaying.Caption = "Now Playing: " & GetFileName(wmpPlayer.URL) End If End Sub Private Sub cmdPlay_Click() wmpPlayer.Controls.Play End Sub Private Sub cmdAdd_Click() If txtName