Can't assign value to object

A

andrew3254

Hello,

I have a text box on a form which gets filled in when it is opened dependant
on who is logged on. The code I have works for other forms but not this one
and I am hitting a dead end trying to fix it. Here is my code:

If CurrentUser() = "User1" Then
Me.Division = "Division1"
Else
Me.Division = "Division2"
End If

I just keep getting run-time errors saying the value cannot be assigned.
The data is not an aggregate, it is a bound text box there is no default
value.
 
B

BruceM

Odd things can happen when a control and a field have the same name. I
don't know if that is the case, and I sort of doubt it will matter if it is,
but if they are the same name (and if the recordset can be updated, as
mentioned in another response) you could try changing the control name to
something like txtDivision. The code wouldn't have to change.
 

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

Top