previewing a report via command button

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have the following section of code on a command button:

Dim stDocName As String

stDocName = "rptSummary"
DoCmd.OpenReport stDocName, acViewPreview, , [Assoc].[ID] = Me.ID

The following error message results from clicking:

Microsoft Access can't find the field "I" referred to in your expression

Anyone know why? Or how to overcome it?
Thank you :)
Renee
 
i see nothing technicallly wrong with your code so i would
start looking else where. the reports control sorce or
query that drives the report.
 
Hi, Renee.

Your WHERE clause must be a valid string expression. Try:

DoCmd.OpenReport stDocName, acViewPreview, , "[Assoc].[ID] = " & Me.ID

Hope that helps.

Sprinks
 
Back
Top