Results 1 to 17 of 17

Thread: Datareport Error

  1. #1

    Thread Starter
    Addicted Member dbasenoob's Avatar
    Join Date
    Jan 2009
    Location
    San Pedro Laguna - Philippines
    Posts
    206

    Datareport Error

    i have error in my data report when i click the command1 it says
    "Data Field 'datess' not found" but i have that in my database and in my datareport

    here's the code
    Code:
    Private Sub Command1_Click()
    Dim rs As New ADODB.Recordset
    Dim myquery As String
    
        myquery = "select code,(datess+', '+lname+' '+fname) as name, addr" & _
        " from info;"
        rs.Open myquery, CN, adOpenStatic
    If rs.RecordCount > 0 Then
        Set DataReport1.DataSource = rs
        DataReport1.Show
    End If
    End Sub

  2. #2
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: Datareport Error

    The recordset contains the fields code, name and addr. Only those names can be specified in a Controls.DataField property on the datareport.

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Datareport Error

    Moved to Reporting

  4. #4

    Thread Starter
    Addicted Member dbasenoob's Avatar
    Join Date
    Jan 2009
    Location
    San Pedro Laguna - Philippines
    Posts
    206

    Re: Datareport Error

    thanks for replying where i can make a changes? im not a good coder so make a quote so that i can i see what will i change

  5. #5
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: Datareport Error

    The DataField property of one of the Controls on the DataReport is set to Datess it should be set to Name.

  6. #6

    Thread Starter
    Addicted Member dbasenoob's Avatar
    Join Date
    Jan 2009
    Location
    San Pedro Laguna - Philippines
    Posts
    206

    Re: Datareport Error

    i change it but it still error... what should i do

  7. #7
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: Datareport Error

    what should i do
    Check all controls in the datareport. check the database. post the error. Become a truck driver.

  8. #8

    Thread Starter
    Addicted Member dbasenoob's Avatar
    Join Date
    Jan 2009
    Location
    San Pedro Laguna - Philippines
    Posts
    206

    Re: Datareport Error

    its works now... but when i print is the preview print is still on page... how can i refresh it? to remove the previews print

  9. #9
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: Datareport Error

    Are you doing it like this to print the report?
    Code:
    DataReport1.PrintReport
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  10. #10

    Thread Starter
    Addicted Member dbasenoob's Avatar
    Join Date
    Jan 2009
    Location
    San Pedro Laguna - Philippines
    Posts
    206

    Re: Datareport Error

    nope only datareport1.show only... i will try that code mr dee-u thanks,salamat

  11. #11
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: Datareport Error

    Filipino? No problem.
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  12. #12

    Thread Starter
    Addicted Member dbasenoob's Avatar
    Join Date
    Jan 2009
    Location
    San Pedro Laguna - Philippines
    Posts
    206

    Re: Datareport Error

    i tried datareport1.printreport its still there the old record... how can i refresh it and remove the old record? yup pinoy ako mr dee-u hehehe...sensya kana po hindi pa ako magaling sa vb6 student pa lang po

  13. #13
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: Datareport Error

    Will you try

    Code:
    Set DataReport1.DataSource = rs
    DataReport1.Refresh
    DataReport1.Show
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  14. #14

    Thread Starter
    Addicted Member dbasenoob's Avatar
    Join Date
    Jan 2009
    Location
    San Pedro Laguna - Philippines
    Posts
    206

    Re: Datareport Error

    its still same...the old record is still in there...

  15. #15
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: Datareport Error

    Could you post the code that you are currently using?
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  16. #16

    Thread Starter
    Addicted Member dbasenoob's Avatar
    Join Date
    Jan 2009
    Location
    San Pedro Laguna - Philippines
    Posts
    206

    Re: Datareport Error

    Code:
    Private Sub Command1_Click()
    Dim rs As New ADODB.Recordset
    Dim myquery As String
    
        myquery = "select code,(datess+', '+lname+' '+fname) as name, addr" & _
        " from info;"
        rs.Open myquery, CN, adOpenStatic
    If rs.RecordCount > 0 Then
        Set DataReport1.DataSource = rs
        DataReport1.Show
    End If
    End Sub
    this is works now...but when i print new data the old data is still on the page...

  17. #17
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: Datareport Error

    You are using the same sql statement so it should be the same, or am I missing something?
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width