DataReport in Visual Basic 6
- From: djamila <djamilabouzid@xxxxxxxxx>
- Date: Sun, 22 Jul 2007 13:40:13 -0700
Hello,
I would like to know if we can bind the same DataReport (Visual Basic
6) to two recordset at the same time.
For example :
Qr1 =" Select EMP_ID, FirstName, LastName from Pers where Function
like 'Employee'"
Rs1.open Qr1, mdbEmployee, adOpenDynamic, adLockPessimistic
Set DataReport.DataSource = Rs1
DataReport.DataMember = ""
DataReport.Sections("Detail").Controls("txtName").DataField =
Rs1(1).Name
If Rs1.RecordCount > 0 then
Rs1.MoveFirst
Do While not Rs1.EOF
Qr2 = "Select DateShift From EmployeeShift Where " & Rs1!EMP_ID &
_
" = Code Order By DateShift"
Rs2.open Qr2, mdbEmployee, adOpenDynamic, adLockPessimistic
Set DataReport.DataSource = Rs2
DataReport.DataMember = ""
If Rs2.RecordCount > 0 then
Rs2.MoveFirst
i =1
Do While i < 30
Find = inValue(i, Rs2)
Txtday = "txt" & i
If Find = true then
DataReport.Sections("Detail").Controls("txtday").
DataField = Rs2(0).Name
Else
DataReport.Sections("Detail").Controls("txtday").
DataField = ""
End if
i = i+1
Loop
End if
Rs1.MoveNext
Loop
End If
DataReport.Refresh
DataReport.Show
End Sub
During the execution I have the following error message:
Runtime error '8526':
DataField 'LastName' not found
I just want to know if we can bind two different RecordSet to the Same
DataReport. If we can't do that, which method can be use to view for
example the calendar of employee ?
Please, give me your answer if you have any information about that.
Regards,
Djamila
.
- Prev by Date: Re: Animatronic Controller
- Next by Date: vbtools microhelp
- Previous by thread: Making a Parser in C++
- Next by thread: vbtools microhelp
- Index(es):
Relevant Pages
|