Attempting to pass value via openargs gives Error 2448 (you can't assign a value)

DataMiner

Registered User.
Local time
Today, 15:02
Joined
Jul 26, 2001
Messages
336
Hi,
I am trying to pass a value from form A to form B via openargs.

This is in response to a "notinlist" event on form A. I am opening form B with the openargs set to the "NewData" parameter generated by the notinlist event on form A.

Then, in the OnOpen event for form B, I set a field's value equal to the openarg.
Me.ctlCell.Value = Me.OpenArgs
It's here that I get the runtime error 2448, "You can't assign a value...."

The weird thing is, if I put this exact same line of code behind a button-click, and then click the button after the form is open, it works fine. Why won't this work in the OnOpen event???

I know I've used OpenArgs like this many times before (Unless, of course, I have finally really lost my mind.)

BTW, Form B is being opened in data entry mode, as a dialog box.

Using Access 2002.

Suggestions appreciated.
 
The Open event of a form is too early in the process to set controls on the form. Use the OnLoad event.
 
Thanks, rural guy! Of course I though of that out as soon as I sent off the post....
 

Users who are viewing this thread

Back
Top Bottom