Re: DataReport in Visual Basic 6
- From: "Ivar" <Ivar.ekstromer000@xxxxxxx>
- Date: Sun, 22 Jul 2007 21:14:18 GMT
"djamila" <djamilabouzid@xxxxxxxxx> wrote in message
news:1185136545.744795.73950@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
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
Not that I really understand the question but I'm sure the answer is NO.
Two suggestions, look at the 'Shape' command for the record source or,
manually create a recordset with code at run time and fill it with the
results of other recordsets and set the datareport.recordsource to the
recordset you created.
Ivar
.
- References:
- DataReport in Visual Basic 6
- From: djamila
- DataReport in Visual Basic 6
- Prev by Date: Re: Find The Text :-)
- Next by Date: Re: How to get the path from Windows Explorer?
- Previous by thread: DataReport in Visual Basic 6
- Next by thread: Looking for API equvalent of xcopy command
- Index(es):
Relevant Pages
|