Re: DataReport in Visual Basic 6

Tech-Archive recommends: Fix windows errors by optimizing your registry




"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


.



Relevant Pages

  • DataReport in Visual Basic 6
    ... I would like to know if we can bind the same DataReport (Visual Basic ... Qr1 =" Select EMP_ID, FirstName, LastName from Pers where Function ... I just want to know if we can bind two different RecordSet to the Same ...
    (microsoft.public.vb.crystal)
  • DataReport in Visual Basic 6
    ... I would like to know if we can bind the same DataReport (Visual Basic ... Qr1 =" Select EMP_ID, FirstName, LastName from Pers where Function ... I just want to know if we can bind two different RecordSet to the Same ...
    (microsoft.public.vb.general.discussion)
  • DataReport in Visual Basic 6
    ... I would like to know if we can bind the same DataReport (Visual Basic ... Qr1 =" Select EMP_ID, FirstName, LastName from Pers where Function ... I just want to know if we can bind two different RecordSet to the Same ...
    (comp.lang.basic.visual.misc)
  • Re: ADO Form bind
    ... setting the control source to County makes the text not updateable that I ... I don't believe you can bind an updatable form to an ADO recordset using the Jet provider. ...
    (microsoft.public.access.formscoding)
  • Re: Bindind a listbox to a recordset using DAO in Access 2000 VBA
    ... > I'm not actually trying to bind to the recordset - maybe I worded that ... "RowSource works only in Excel, and only to bind ... return a two-dimensional array. ... Forms.Controls!List3.Column= arrData ...
    (microsoft.public.word.vba.general)