Microsoft Access Open Form Openargs Null

In the new form I initially 'seemed to have' fixed the problem by capturing me.openargs value into a variable in the FormOpen event. Now, that is passing as Null. I've tried structuring the calling code directly using me.Name, tried it by setting a string variable to me.Name's value then passing that, even tried various combinations. Mar 14, 2019 To use the OpenArgs property, open a form by using the OpenForm method of the DoCmd object and set the OpenArgs argument to the desired string expression. The OpenArgs property setting can then be used in code for the form, such as in an Open event procedure. Nov 04, 2019 The report open event starts. Private Sub ReportOpen(Cancel As Integer) 'Alter the SQL for the report based on the open arg Dim strSQL As String. MsgBox Me.OpenArgs. I added the message box when this odd event started to happen.

-->

Determines the string expression specified by the OpenArgs argument of the OpenForm method that opened a form. Read/write Variant.

Syntax

expression.OpenArgs

expression A variable that represents a Form object.

Remarks

This property is available only by using a macro or by using Visual Basic with the OpenForm method of the DoCmd object. This property setting is read-only in all views.

To use the OpenArgs property, open a form by using the OpenForm method of the DoCmd object and set the OpenArgs argument to the desired string expression. The OpenArgs property setting can then be used in code for the form, such as in an Open event procedure. You can also refer to the property setting in a macro, such as an Open macro, or an expression, such as an expression that sets the ControlSource property for a control on the form.

For example, suppose that the form that you open is a continuous-form list of clients. If you want the focus to move to a specific client record when the form opens, you can set the OpenArgs property to the client's name, and then use the FindRecord action in an Open macro to move the focus to the record for the client with the specified name.

Example

The following example uses the OpenArgs property to open the Employees form to a specific employee record, and demonstrates how the OpenForm method sets the OpenArgs property. You can run this procedure as appropriate; for example, when the AfterUpdate event occurs for a custom dialog box used to enter new information about an employee.


Microsoft Access Open Form Openargs Null Test

The following example shows how to use the OpenArgs property to prevent a form from being opened from the navigation pane.

Support and feedback

Microsoft Access Open Form Openargs Null

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.

OpenArgs sometimes NULL, Why?

Microsoft Access Open Form Openargs Null Statement

OpenArgs sometimes NULL, Why?

Microsoft Access Open Form Openargs Null And Alternative

Hello,
I have had some wierd things happen with Access Forms. First the linkcriteria is getting passed correctly(set properly in the openform command) when the form_open function is called in the new form the openargs variable is null, why is that? Also some global variables are getting lost somewhere, i have to close the form and open it again. I am trying to get away from useing globals but this is still disconcerting. The only other things is that I have seen the sql fail and rollback the transaction and yet the changes are still saved. I don't get it. One question, when you use docmd.menuitem to save, does it respect transactions(meaning if an error occurs in a seperate sql statement and I rollbakc the transaction, will it also rollback. Also is there a good tutorial somewhere about creating classes in VBA(with inheritance and polymorphism - or their limitations)? I realize that some of my problems might be my programming techniques, I am asking to learning so don't be shy on the criticism(do it in love though :)). Thanks for answering my silly questions.
Questions:
1) lost Open args
2) lost variables
3) flaky transactional stuff
4) building classes in VBA
5) why is the sky blue
6) why do elephants like peanuts
.....
Thanks
JoeSmoe