var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Error ingenerating the report in access
I am using this following simple code to generate report in Access(In the line between * signs), bu im getting error Saying :: ITEM NOT FOUND IN COLLECTION
Private Sub cmd_report_Click()
Dim sql As String
sql = "select * from [Job_Flow]"
******* CurrentDb.QueryDefs.Delete "Job_Flow_query" *******
CurrentDb.CreateQueryDef "Job_Flow_query", sql DoCmd.OpenReport "Job Report", acViewPreview
whr "Job_Flow_query" is name of the query used for gfenerating the report
"job Report" is name of the report
Originally Posted by syam1919
1. sql = "select * from " & [Job_Flow]
Why don't you use DoCmd.OpenReport "Job_Flow_query",acViewPreview
to open the report.
I am getting error in the following line
the error I am getting is Item not found in this collection.
I tried with using folliowing
Dim qdf As QueryDefs
eveni am facing the same problem
The proper way to delete an object in VBA is:
DoCmd.DeleteObject acQuery, "QueryName"
Although there are other ways to skin the cat, this is the most reliable.
Also, a possible reason the object doesn't exist is because your syntax needs polishing. Try this:
without using the "sql" keyword. The word "sql" is a "reserved word," and might be confusing the program. Try "strSQL" instead as your string variable.
Last edited by Sam Landy; 02-22-05 at 12:34.