INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Data Report Error

Data Report Error

(OP)
Dim obj, rs As ADODB.recordset, SQL As String


Call db_conn
      Set rs = New ADODB.recordset

    
    strString = " SELECT cusname,idnumb,mobi,pron,proc,blkno,lannum,sqland,cost,comiso,addit,deduc,gtot,vali,rename" & _
                 " From reser" & _
                 " WHERE reno = '" & Combo1.Text & "' "

   
    rs.Open strString, DB, adOpenStatic
    Set rs = DB.Execute(strString)
      'With reportPS
       If Not rs.EOF Then
       Set Reservation.DataSource = rs.DataSource


'-----------------------------------------------------------------------------------------------'
'PageHeader
Reservation.Sections("PageHeader").Controls("lblcusname").Caption = CStr(rs!cusname)
Reservation.Sections("PageHeader").Controls("lblidnumber").Caption = CStr(rs!idnumb)
Reservation.Sections("PageHeader").Controls("lblmobile").Caption = CStr(rs!mobi)
Reservation.Sections("PageHeader").Controls("lblPron").Caption = CStr(rs!pron)
Reservation.Sections("PageHeader").Controls("lblProc").Caption = CStr(rs!proc)
Reservation.Sections("PageHeader").Controls("lblBlkno").Caption = CStr(rs!blkno)
Reservation.Sections("PageHeader").Controls("lblLn").Caption = CStr(rs!lannum)
Reservation.Sections("PageHeader").Controls("lblsql").Caption = CStr(rs!sqland)
Reservation.Sections("PageHeader").Controls("lblcost").Caption = CStr(rs!cost)
Reservation.Sections("PageHeader").Controls("lbCommi").Caption = CStr(rs!comiso)
Reservation.Sections("PageHeader").Controls("lblAdd").Caption = CStr(rs!Addit)
Reservation.Sections("PageHeader").Controls("lblDed").Caption = CStr(rs!deduc)
Reservation.Sections("PageHeader").Controls("lblGt").Caption = CStr(rs!Gtot)
Reservation.Sections("PageHeader").Controls("lblVali").Caption = CStr(rs!vali)
Reservation.Sections("PageHeader").Controls("lblrname").Caption = CStr(rs!rename)
Reservation.Sections("PageHeader").Controls("lblcname").Caption = CStr(rs!cusname)
Reservation.Sections("PageHeader").Controls("lblvali1").Caption = CStr(rs!vali)
'-----------------------------------------------------------------------------------------------'


Reservation.Refresh
Reservation.Show vbModal


End If
'End With


'For Each obj In reportPS.Sections("PageHeaders").Controls
 '   If TypeOf obj Is RptTextBox Then
  '      obj.DataMember = rs.DataMember

'End If
'Next


********
Error

Run Time Error:2147467259(80004005)
Method 'Sections' of Object 'Reservation' Failed  

RE: Data Report Error

First, you may get better results here: forum222: Visual Basic(Microsoft): Version 5 & 6

That being said, check the properties of your sections; usually they are named by default with a number, such as drMemberInvoice.Sections("Section2").Controls("lblSection").Caption = strSection.

Section2 in this particular dr corresponds to the report header section.

Gluais faicilleach le cupan làn

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close