Report details do not show from code

kevin24

Registered User.
Local time
Today, 14:18
Joined
Feb 24, 2011
Messages
30
Hi,
This is my first attempt at select case etc.
I have a form with various controls to set values for year, month, quarter, filter, info by.
The data comes from a query named "qrydiscanalysis"
I have Dim both ReportName and Albums as Strings

There are a total of 3 Cases, Year, Quarter and Month
Case 1 is:-

Case ByYear
strReportName = "Yearly Album Report"
Albums = DLookupStringWrapper("AlbumName", "qryDiscAnalysis", "[Year]=" & Me.cbYear)
Ater which The various diferent object variables for the report are added:-
If Albums <> "" Then
TempVars.Add "Group By", Me.lstAlbumReports.Value
TempVars.Add "Display", DLookupStringWrapper("[Display]", "Album Reports", "[Group By]='" & Nz(Me.lstAlbumReports) & "'")
TempVars.Add "Year", Me.cbYear.Value
TempVars.Add "Quarter", Me.cbQuarter.Value
TempVars.Add "Month", Me.cbMonth.Value
DoCmd.OpenReport strReportName, ReportView, , strReportFilter, acWindowNormal
End If
I get an error message
" Run-yime error 3131
Syntax error in From Clause"
I want to use Dlookup and not a query but I need a bit of help to show me where I am going wrong. Thanks
 
Hi kevin24

It would be nice to know where the code fails.
Have you tried stepping through the code to see at which line it breaks?
 
Hi,

Not sure if I have done correctly.

On the Debugging Menu I have
Step Into, Step Over, Step Out.

If I go Step Into nothing happens
except sound.

When I click the do you want to
debug message it goes to line

DoCmd.OpenReport strReportName, ReportView, , strReportFilter, acWindowNormal

Thanks
 

Users who are viewing this thread

Back
Top Bottom