Results 1 to 2 of 2

Thread: DataGrid Question

  1. #1

    Thread Starter
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418
    Im having an extremely hard time with this dang
    DataGrid!!! {{{Laughing}}} Im not to sure of what
    im doing wrong.

    With DataGrid1
    .Columns.Add(0).Caption = "Account Name"
    .Columns.Add(1).Caption = "Driver ID"
    .Columns.Add(2).Caption = "# of Tickets"
    .Col = 0
    .Row = 0
    .Text = "Shaka Zulu"
    End With

    The column headers come out good but if i try
    just to print a string in a column i get a run time
    error "7005 Row Set not Available" As for now im just trying to get something in my DataGrid. Anything !!!
    What i am ultimately trying to do is open a recordset
    with an SQL statement and fill in the first column
    with the results of the SQL string.

    Set db = OpenDatabase("C:\Database.mdb")
    strSQL = "SELECT * From [Account Information]"
    Set rs = db.OpenRecordset(strSQL)

    With DataGrid1
    .DataSource = rs
    .Columns.Add(0).Caption = "Account Name"
    .Columns.Add(1).Caption = "Driver ID"
    .Columns.Add(2).Caption = "# of Tickets"
    End With

    Do Until rs.EOF
    DataGrid1.Text = rs![Account Name]
    rs.MoveNext
    DataGrid1.Row = DataGrid1.Row + 1
    Loop
    Thanks All............

  2. #2
    New Member
    Join Date
    Aug 2000
    Location
    Brazil
    Posts
    14
    ???
    you want the Datagrid to show your query results?!?!?!


    Set Datagrid.Datasource = Recordset


    that´s all.... you need
    by Ramosf

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width