A
Amit
MS Access 2K, Windows XP
=====================
Hi,
I have a simple form with the following code in the forms's On Load event:
=====
Me.RecordCreatePerson = fOSUserName()
MsgBox "Current user is " & CurrentUser()
Me.CurrentUserName = CurrentUser()
=====
I also have hidden text controls on the form bound to the corresponding
fields (of type text) for capturing Windows/Network username and the Access
username in the table.
When I open the form, there are instances when it works fine (the value from
fOSUserName and CurrentUser are nicely stored in the table), and at some
other instances, it gives me the error at the first line:
"You can't assign a value to this object."
The only other code I have is in the form's On Open event -
"Docmd.Maximize", and of course, the module.
Is there any reason why this would work some time, and not other times? The
message says "run time error '-2147352567 (80020009)': You can't assign a
value to this object."
Should this code be placed in the OnCurrent event of the form instead? I
think On Open is too early to assign values.
Thanks.
-amit
=====================
Hi,
I have a simple form with the following code in the forms's On Load event:
=====
Me.RecordCreatePerson = fOSUserName()
MsgBox "Current user is " & CurrentUser()
Me.CurrentUserName = CurrentUser()
=====
I also have hidden text controls on the form bound to the corresponding
fields (of type text) for capturing Windows/Network username and the Access
username in the table.
When I open the form, there are instances when it works fine (the value from
fOSUserName and CurrentUser are nicely stored in the table), and at some
other instances, it gives me the error at the first line:
"You can't assign a value to this object."
The only other code I have is in the form's On Open event -
"Docmd.Maximize", and of course, the module.
Is there any reason why this would work some time, and not other times? The
message says "run time error '-2147352567 (80020009)': You can't assign a
value to this object."
Should this code be placed in the OnCurrent event of the form instead? I
think On Open is too early to assign values.
Thanks.
-amit