combo box value equals text box value

SpiritedAway

Registered User.
Local time
Today, 06:44
Joined
Sep 17, 2009
Messages
97
Hi All,

I've got a text box on my main form [txtuser] which displayers the user's name.

I have a subform [SetupUsersSub00] - with a combo box [Person]

on the OnLoad event I want the value of [txtuser] to insert into [Person]. The code I'm using is:

Forms!SetupUsers.Form!SetupUsersSub00.Form!Person.Column (1) = Me.txtUser

The users name is in the combo box - so the value does exist however I'm getting an error message that says:

The Value you entered isn't valid for this field.


The idea behind it - is that the person who creates the record has to select their own name from the combo box to assign it to themselves and they usually forget - I thought it would be easier if it did it automatically.

The purpose of the combo box is so that the person who created the record can then assign a task to users other than himself if they want to. The subform [SetupUsersSub00] is a continuous form.

Using Access 2007

Any ideas how to accomplish this would be great.

Thanks
 
Forms!SetupUsers.Form!SetupUsersSub00.Form!Person.Column (1) = Me.txtUser
Access is balking because you cannot assign a value to a particular Column of a Combobox in this way.

Person.Column (1) = Me.txtUser

won't work but

Person.Value = Me.txtUser

or simply

Person = Me.txtUser

will, assuming that the Bound Column of the Combobox is the one that holds the user's name.

Linq ;0)>
 

Users who are viewing this thread

Back
Top Bottom