Article ID: 150468
Article Last Modified on 6/29/2004
Control Default Name Property Value
---------------------------------------------------------------
Data Control Data1 DatabaseName BIBLIO.MDB
RecordSource Title
DBGrid Control DBGrid1 DataSource Data1
Option Explicit
Dim sql As String
Private Sub Command2_Click()
' SQL statement that does not return records.
sql = "SELECT * From Titles Where Title = Null"
Data1.RecordSource = sql
Data1.Refresh
Command1.Visible = True
Command2.Visible = False
End Sub
Private Sub Command1_Click()
' Set the RecordSource to fill the DBGrid control.
Data1.RecordSource = "Titles"
Data1.Refresh
Command1.Visible = False
Command2.Visible = True
End Sub
Private Sub Form_Load()
Command1.Caption = "Fill DBGrid"
Command1.Visible = False
Command2.Caption = "Clear DBGrid"
Command2.Visible = True
End Sub
Additional query words: kbVBp400 kbVBp600 kbdse kbDSupport kbVBp
Keywords: kbhowto KB150468