PC Review


Reply
Thread Tools Rate Thread

can't open report on current record

 
 
=?Utf-8?B?R2Vvcmdl?=
Guest
Posts: n/a
 
      16th Sep 2004
Hi I need help
I have a report that populates from a query and I want the report to open on
the current record basede on the form and subform current fields.
My code is as follows

Private Sub btnPrintReport_Click()
On Error GoTo Err_btnPrintReport_Click

Dim stDocName As String

stDocName = "Agreement"
Dim strWhere As String
If Me.Dirty Then 'save first
Me.Dirty = False
End If
If Me.NewRecord Then
MsgBox "Select the record to print."
Else

strWhere = "[Customers_CustomerID] = " & Forms![ProjectsAll]![Customers
Subform].Form![Customers_CustomerID]
DoCmd.OpenReport stDocName, acViewPreview, , strWhere
End If

Exit_btnPrintReport_Click:
Exit Sub

Err_btnPrintReport_Click:
MsgBox Err.Description
Resume Exit_btnPrintReport_Click

End Sub

Any help greatly appreciated
Thanks
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Email a single record or current record from a report tigercop Microsoft Access VBA Modules 2 20th Dec 2007 03:18 AM
report based on single record/prints current record only HELP!!! =?Utf-8?B?SmVhbi1GcmFuY29pcyBHYXV0aGllcg==?= Microsoft Access Reports 4 9th Mar 2007 11:25 PM
Linking a PDF file of the current record to the current record Angie Microsoft Access External Data 0 3rd Feb 2006 10:08 PM
Find Record action to display a record that is the current record on another for Tom K via AccessMonster.com Microsoft Access Macros 0 31st Oct 2005 08:45 PM
Current Record Count, Previous Record #, Add New Record =?Utf-8?B?Um9iZXJ0IE51c3ogQCBEUFM=?= Microsoft Access Forms 0 15th Feb 2005 09:35 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:12 AM.