Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unbound Fields on a Data Report 1

Status
Not open for further replies.

zgtrman

Programmer
Dec 4, 2002
62
0
0
US
Since Search is down...I am forced to this...

I am having a problem with my DataReport...
I have unbound fields in the detail section and have written an SQL statement to fill those fields from a database. Eventually I will modify the SQL statement to include user inputs but for now I want the report to work
But I am getting a runtime error saying is cannot locate DataFields...so I tried replacing the offending datafield but then the error just goes to the next field.

The DataReport DataField Names are:
HorseName
Ddate
Miles
Location
Terrain
Notes

The calling form codes is as follows:
(note: the Sql statement is all on one line but will not show that way in this forum)

Option Explicit
Private cnDB As ADODB.Connection


Private Sub Command2_Click()

Dim strSQL As String
strSQL = "SELECT 'ride.HorseName AS Horse', 'ride.date AS Ddate', 'ride.Location AS Location', 'ride.Mileage AS Miles', 'ride.Terrain AS Terrain', 'ride.Notes AS Notes' FROM ride;"
With rptRideQuery
Set .DataSource = cnDB.Execute(strSQL)
.Orientation = rptOrientLandscape
.Show
End With
End Sub

Private Sub Form_Load()
Set cnDB = New ADODB.Connection
cnDB.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\Recovered\EqiPhonics\Program\Ride.mdb;Persist Security Info=False"
cnDB.Open
End Sub

To effectively improve in the efficiency of your performance, one must be proficient in the implementation of a positive mental attitude.
 
Try removing the single quotes and the semi-colon from your SELECT statement.

Hope this helps,
Ralph
 
RalphBrown,

I had put the single quotes and semi-colon in their because I was getting another SQL error without them...but today when I removed them the Report worked. Must have been a quirk in my system...beats me..but thank you.


zgtrman To effectively improve in the efficiency of your performance, one must be proficient in the implementation of a positive mental attitude.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top