Results 1 to 3 of 3

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!!!!


    [vb 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]

    [/vb code]

  2. #2
    Let me in .. techyspecy's Avatar
    Join Date
    Aug 2002
    Location
    Back to VBF.
    Posts
    2,456
    Check the attachment. Add a grid to your form and reference to ADO library.
    Attached Files Attached Files

  3. #3

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