Go Back   Access World Forums > Microsoft Access Discussion > Forms

 
Reply
 
Thread Tools Rating: Thread Rating: 10 votes, 5.00 average. Display Modes
Old 06-08-2012, 07:58 AM   #1
tpuhlig
Newly Registered User
 
Join Date: Nov 2009
Location: Sacramento, CA
Posts: 15
Thanks: 3
Thanked 1 Time in 1 Post
tpuhlig is on a distinguished road
You can't assign a value to this object

I was working in my form and came up with this error.
"You can't assign a value to this object "

When I open up the form, it points me to the On load code.

Private Sub Form_Load()
txtCompletedBy = Environ("USERNAME")
End Sub

This was working fine. I removed the code to try to trouble shoot it.
If the code is removed, all I get on open is a blank form. I can't see anything. In designed mode, everything is there.

I can go back to my last backup but hopefully I can figure out the issue first. Last back up would need some updating.

Anyone with any ideals that could cause this?

I looked at some old post and it said to check the box type. It is text and the username is text.

tpuhlig is offline   Reply With Quote
Old 06-08-2012, 08:07 AM   #2
delikedi
Newly Registered User
 
Join Date: Apr 2012
Location: Istanbul, Turkey
Posts: 87
Thanks: 5
Thanked 13 Times in 12 Posts
delikedi is on a distinguished road
Re: You can't assign a value to this object

The only times I remember getting that error is when txtCompletedBy is has a control source, either as a calculated expression or as a field of underlying record source. ın other words, in design mode, txtCompletedBy should be filled with the word "Unbound".
delikedi is offline   Reply With Quote
The Following User Says Thank You to delikedi For This Useful Post:
iMagic (04-10-2017)
Old 06-08-2012, 08:30 AM   #3
veraloopy
Newly Registered User
 
Join Date: Apr 2009
Posts: 137
Thanks: 1
Thanked 6 Times in 6 Posts
veraloopy is on a distinguished road
Re: You can't assign a value to this object

Check your form settings, make sure Allow Edits is set to Yes and also check which section of the form you have placed all the fields in.
I accidentally put some text boxes in the Page Header/Footer which do not show in form view mode, make sure your text boxes are in the Detail section at least..
Finally, check the text box itself, make sure you havent put any data validation, input mask or date format, etc.
It may be better to create a new text box in the Detail section and temporarily change the code you already have to use this new text box instead - if it works then you know the old text box is the problem

veraloopy is offline   Reply With Quote
The Following User Says Thank You to veraloopy For This Useful Post:
tpuhlig (06-08-2012)
Old 06-08-2012, 08:36 AM   #4
tpuhlig
Newly Registered User
 
Join Date: Nov 2009
Location: Sacramento, CA
Posts: 15
Thanks: 3
Thanked 1 Time in 1 Post
tpuhlig is on a distinguished road
Re: You can't assign a value to this object

I do have it unbound because i need to collect that information. It was working fine for a week this way.

Ok, just to test it, I removed it and made it unbound. Still does the same thing.


Quote:
Originally Posted by delikedi View Post
The only times I remember getting that error is when txtCompletedBy is has a control source, either as a calculated expression or as a field of underlying record source. ın other words, in design mode, txtCompletedBy should be filled with the word "Unbound".
tpuhlig is offline   Reply With Quote
Old 06-08-2012, 08:46 AM   #5
tpuhlig
Newly Registered User
 
Join Date: Nov 2009
Location: Sacramento, CA
Posts: 15
Thanks: 3
Thanked 1 Time in 1 Post
tpuhlig is on a distinguished road
Re: You can't assign a value to this object

Yes, checked it and it is set to allow edits when the form open in designed mode.

I have macro that sets it to no after the first insert. I did this because when a user is entering a record, if they scroll their mouse, it would go to a new record. Setting it to no after the first field is inserted into the table would make it stay on this record only.

This was working fine for days. I removed the marco to see if this was preventing it to load, it still does not load.



Quote:
Originally Posted by veraloopy View Post
Check your form settings, make sure Allow Edits is set to Yes and also check which section of the form you have placed all the fields in.
I accidentally put some text boxes in the Page Header/Footer which do not show in form view mode, make sure your text boxes are in the Detail section at least..
Finally, check the text box itself, make sure you havent put any data validation, input mask or date format, etc.
It may be better to create a new text box in the Detail section and temporarily change the code you already have to use this new text box instead - if it works then you know the old text box is the problem
tpuhlig is offline   Reply With Quote
Old 06-08-2012, 09:05 AM   #6
veraloopy
Newly Registered User
 
Join Date: Apr 2009
Posts: 137
Thanks: 1
Thanked 6 Times in 6 Posts
veraloopy is on a distinguished road
Re: You can't assign a value to this object

Quote:
I have macro that sets it to no after the first insert. I did this because when a user is entering a record, if they scroll their mouse, it would go to a new record. Setting it to no after the first field is inserted into the table would make it stay on this record only
I found a way around this by going to the Form properties and on the 'Other' tab, change the 'Cycle' to Current Record. The default is All Records.
veraloopy is offline   Reply With Quote
The Following User Says Thank You to veraloopy For This Useful Post:
tpuhlig (06-08-2012)
Old 06-08-2012, 12:24 PM   #7
tpuhlig
Newly Registered User
 
Join Date: Nov 2009
Location: Sacramento, CA
Posts: 15
Thanks: 3
Thanked 1 Time in 1 Post
tpuhlig is on a distinguished road
Re: You can't assign a value to this object

Quote:
Originally Posted by veraloopy View Post
I found a way around this by going to the Form properties and on the 'Other' tab, change the 'Cycle' to Current Record. The default is All Records.
I tried this in my backup form. It still shifts to a new record.

tpuhlig is offline   Reply With Quote
Old 06-08-2012, 12:40 PM   #8
tpuhlig
Newly Registered User
 
Join Date: Nov 2009
Location: Sacramento, CA
Posts: 15
Thanks: 3
Thanked 1 Time in 1 Post
tpuhlig is on a distinguished road
Re: You can't assign a value to this object

Quote:
Originally Posted by veraloopy View Post
Check your form settings, make sure Allow Edits is set to Yes ......
Ok, fixed it. I went line by line with my back up form to see what was different.

"Allow additions" was set to "NO"

My finger must have slipped?

Thanks everyone for your input!
Tom

tpuhlig is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
You can't assign a value to this object iglobalusa Forms 10 05-02-2010 08:59 PM
Can't assign value to an object BobMcL Forms 1 03-19-2006 08:59 PM
You cant assign a value to this object?? desibasha General 0 04-08-2004 02:02 PM
You can't assign a value to this object skwilliams Forms 4 11-03-2003 08:55 AM
You can't assign a value to this object gilberto Forms 2 03-13-2003 09:55 AM




All times are GMT -8. The time now is 06:37 PM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World