Access OpenArgs in Access 2010 failing

Mar 2, 2015
Reaction score
I am using Access 2010 (for the first time) and finding that OpenArgs does not work with reports. When I start typing DoCmd.OpenReport Intellisense prompts for OpenArgs (which suggests it ought to work). If I then attach code to the Load event of the form (I try to set the OpenArgs value as the value in a text field) I get error 2185 'You can't reference a property or method for a control unless the control has focus'. If I try to give the control focus I get Runtime Error 2950 'Reserved Error'. The code is very simple and I have used it many times before with earlier versions of Access,

Private Sub Report_Load()
If IsNull(OpenArgs) Then
Me.txtReportTitle.Text = "No argument passed"
Me.txtReportTitle.Text = OpenArgs
End If

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