We help IT Professionals succeed at work.

set value for textfield in a adp project

311 Views
Last Modified: 2013-12-05
It is the first time I use an adp project (access 2003 front-end and sql server 2000) and I have a lot of suprises, because things I normaly did in Access, does not work anymore :

eg In the OnOpen event of a form, I regulary set the value for a textfield on the form
say txtfield (bound to a table) is txtUserName.
Then I set this as follows:
Me.txtUserName = gbl_UserName  
(where gbl_UserName is a global that is initiated at start-up)
or
Me.txtUserName = "Bill"
This to avoid that users need to enter this value.
When I try this in my adp project, I get an errror "you can't assign a value to this object....."

I would be very pleased if someone could tell me how I can solve this problem.




Comment
Watch Question

Scott McDaniel (EE MVE )Infotrakker Software
CERTIFIED EXPERT
Most Valuable Expert 2012
Top Expert 2014

Commented:
Perhaps your form, or the table/query driving the form, are not updateable? What did you base this form on? IN SQL Server, all tables must have a Primary Key in order to be updateable ...

Author

Commented:
The form is based on a table that has a primary key:
FunctioID of typ Unique Identifier, a foreign key PlantID, FunctionDescription and four fields CreationUser, CreationDate, ModifUser and Modif Date.
Actually, I want via the form that the user only need to fill out the FunctionDescription, and set automatically the other fields.
Because  PlantID is different for people of different plants, I cannot use the default value in the table, and also the CreationUser is changing of course.
Because these values are set on login through global variables in my access front-end, I wanted these to put in the fields of the form.  And there it goes wrong......            
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.