|
-
Jan 30th, 2009, 11:12 AM
#1
Thread Starter
Addicted Member
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
-
Jan 30th, 2009, 11:45 AM
#2
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.
-
Jan 30th, 2009, 11:54 AM
#3
-
Jan 30th, 2009, 12:04 PM
#4
Thread Starter
Addicted Member
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
-
Jan 30th, 2009, 12:39 PM
#5
Re: Datareport Error
The DataField property of one of the Controls on the DataReport is set to Datess it should be set to Name.
-
Jan 30th, 2009, 01:10 PM
#6
Thread Starter
Addicted Member
Re: Datareport Error
i change it but it still error... what should i do
-
Jan 30th, 2009, 01:38 PM
#7
Re: Datareport Error
Check all controls in the datareport. check the database. post the error. Become a truck driver.
-
Jan 31st, 2009, 11:09 AM
#8
Thread Starter
Addicted Member
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
-
Jan 31st, 2009, 11:40 AM
#9
Re: Datareport Error
Are you doing it like this to print the report?
Code:
DataReport1.PrintReport
-
Jan 31st, 2009, 11:10 PM
#10
Thread Starter
Addicted Member
Re: Datareport Error
nope only datareport1.show only... i will try that code mr dee-u thanks,salamat
-
Feb 1st, 2009, 02:15 AM
#11
-
Feb 1st, 2009, 08:28 AM
#12
Thread Starter
Addicted Member
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
-
Feb 1st, 2009, 10:24 AM
#13
Re: Datareport Error
Will you try
Code:
Set DataReport1.DataSource = rs
DataReport1.Refresh
DataReport1.Show
-
Feb 1st, 2009, 10:32 AM
#14
Thread Starter
Addicted Member
Re: Datareport Error
its still same...the old record is still in there...
-
Feb 1st, 2009, 10:50 AM
#15
Re: Datareport Error
Could you post the code that you are currently using?
-
Feb 1st, 2009, 11:13 AM
#16
Thread Starter
Addicted Member
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...
-
Feb 1st, 2009, 11:19 AM
#17
Re: Datareport Error
You are using the same sql statement so it should be the same, or am I missing something?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|