How do I open the Relationships report in Access using VB code?

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

Guest

I have created a command button which I want to use to open the Relationships
report. I had been supplied some code shown below but it is not working.

Private Sub cmdApplicationDataModel_Click()
On Error GoTo errHandler
DoCmd.Echo False, ""
DoCmd.OpenReport "rptRelationship", acViewPreview
DoCmd.Maximize
DoCmd.Echo True, ""
errHandler:
DoCmd.Echo True
Exit Sub
End Sub
 
If you saved the relationship report with the name rptRelationship, you can
open it with:
DoCmd.OpenReport "rptRelationship", acViewPreview

If you do not have a relationship report saved, you can open the
Relationships window in Access 2002 and later like this:
RunCommand acCmdRelationships
RunCommand acCmdPrintRelationships

In Access 2000, you can do it with:
RunCommand acCmdRelationships
SendKeys "%FR", True
 
Back
Top