Linking Report to Form in Access 2003

staholly

Registered User.
Local time
Today, 14:47
Joined
Jul 14, 2011
Messages
16
I want to be able to open report with button that only shows the report to the current form record.
 
I'm confused. what do I write to linked the form "rnid" to the report id "rnid"?
 
Presuming it's numeric:

"rnid= " & Me.rnid
 
I'm not really good with vba can you right in detail. What you referred me to is not in detail. Maybe i need to explain a little more.
I have a form it's call frmRnCompletion. It has id field name RNcompletionID (number filed).
I have a form called qryCSGAuditWorksheet it also has a RNcompletionID (it's linked to RNcompletion table)
I want to create a button on the frmRNcompletion form it opens up the report associated to.

This is what I have written so far:
Private Sub Command27_Click()
On Error GoTo Err_Command27_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "qryCSGAuditWorksheet"
DoCmd.OpenReport stDocName,acViewPreview,,

what elese do I need to?
 
You don't have to be good with VBA, you just have to copy/paste your names. Try:

DoCmd.OpenReport stDocName,acViewPreview,,"RNcompletionID = " & Me.RNcompletionID
 

Users who are viewing this thread

Back
Top Bottom