Pulling a single page report

M

maura

I have formatted a report as a letter to go out to the
individual who's information is on the screen. I want the
user to be able to preview the letter for that individual
and then to print it. For some reason when I created the
command button it will preview the letter for all the
individuals in the database (code below) and when I add:

DoCmd.OpenReport stDocName, acPreview, , strcriteria

it brings up the letter but none of the fields are
populated. Please tell me what I am missing.

Thanks, Maura



All Individuals:

Private Sub cmdReminderLetter_Click()
On Error GoTo Err_cmdReminderLetter_Click

Dim stDocName As String
Dim intAccount As Integer
Dim strcriteria As String

strcriteria = "Account= " & Me.Account

stDocName = "rptReminderLetter"
DoCmd.OpenReport stDocName, acPreview,

Exit_cmdReminderLetter_Click:
Exit Sub

Err_cmdReminderLetter_Click:
MsgBox Err.Description
Resume Exit_cmdReminderLetter_Click

End Sub
 
M

Michel Walsh

Hi,


Probably that no record satisfy the criteria? but that is probably not the
case, but anyhow, what is the value actually stored in strCriteria?
removing it (and the hanging comas of the DoCmd statement) solve the
problem?


Hoping it may help,
Vanderghast, Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top