-
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
-
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.
-
Re: Datareport Error
-
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
-
Re: Datareport Error
The DataField property of one of the Controls on the DataReport is set to Datess it should be set to Name.
-
Re: Datareport Error
i change it but it still error...:( what should i do
-
Re: Datareport Error
Check all controls in the datareport. check the database. post the error. Become a truck driver.
-
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
-
Re: Datareport Error
Are you doing it like this to print the report?
Code:
DataReport1.PrintReport
-
Re: Datareport Error
nope only datareport1.show only... i will try that code mr dee-u thanks,salamat
-
Re: Datareport Error
-
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
-
Re: Datareport Error
Will you try
Code:
Set DataReport1.DataSource = rs
DataReport1.Refresh
DataReport1.Show
-
Re: Datareport Error
its still same...the old record is still in there...
-
Re: Datareport Error
Could you post the code that you are currently using?
-
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...
-
Re: Datareport Error
You are using the same sql statement so it should be the same, or am I missing something?