|
-
Feb 20th, 2003, 05:46 PM
#1
Thread Starter
Lively Member
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]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|