Remember you could also look in the help files (hit F1 in the vba editor) for a more precise explanation on the Docmd.OpenReport method.
Do you have the code in the CLICK event of the button? The code block should look something like this (assuming Command1 is the name of the button):
I've modified your code a bit so you use the above line in bold.
Do you have the code in the CLICK event of the button? The code block should look something like this (assuming Command1 is the name of the button):
Code:
Private Sub Command1_Click()
[B] DoCmd.OpenReport "rpt_risktype", , , "Risk_ID = " & Val(Me.Risk_ID)[/B]
End Sub
I've modified your code a bit so you use the above line in bold.