Results 1 to 2 of 2

Thread: Help!!!

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2003
    Posts
    67

    Exclamation Help!!!

    I am trying to populate a datagrid with the following code.
    My problem is binding the datagrid to the recordset.
    It works in a text box E.g

    "txtDate = rsStudents![Transaction_Date]"
    but I dont know how to put a datagrid into this context

    dbgAppointments = rsStudents....?????

    PLEASE HELP!!!!


    [code]
    Private Sub cmdHistory_Click()

    Dim clientid As Integer
    clientid = txtC_No

    Set comHistory = New Command
    Set rsHistory = New Recordset

    With comHistory
    .ActiveConnection = cnDetails
    .CommandText = "SELECT History.Transaction_Date, tblStyle.Style, History.Formula, History.Colour_Desc, tblStaff.S_F_Name, tblClient.C_Number FROM tblStyle INNER JOIN (tblStaff INNER JOIN (tblClient INNER JOIN History ON tblClient.C_Number = History.C_Number) ON tblStaff.S_Number = History.S_Number) ON tblStyle.Style_Number = History.Style_Number Where tblClient.C_Number = " & clientid & " Order By History.Transaction_Date Desc "
    End With

    Set rsHistory = comHistory.Execute
    Set dbgAppointments.DataSource = rsHistory
    dbgAppointments = rsHistory![Style]

    [/ code]

  2. #2
    New Member
    Join Date
    Feb 2003
    Location
    Delhi-India
    Posts
    10
    u cannot connect to a datagrid datasource using all code, use a dataenvironment or a ado data control and set grids datasource to the environment or the data control.

    Then work

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