Go Back   Access World Forums > Microsoft Access Discussion > Queries

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 08-15-2014, 08:17 AM   #1
OBBurton
Newly Registered User
 
Join Date: Dec 2013
Location: Columbus, Ohio, USA
Posts: 77
Thanks: 76
Thanked 1 Time in 1 Post
OBBurton is on a distinguished road
You can't assign a value to this object

I have a line of code that used to work and now does not. I must have changed something, but the only things I am aware of are cosmetic. The code is:
Public Sub ResetTime()
Dim DesiredVal As String
DesiredVal = "= 'Your last activity on Wilbur was at '" _
& " & Format(Now(),'Medium Time')"
DoCmd.Close acForm, "frmWarning"
Forms!frmHidden.TimerInterval = 900000
Forms!frmMain!txtTimeStamp.Value = DesiredVal
Forms!frmHidden!chkActive = True
End Sub

It crashes on "Forms!frmMain!txtTimeStamp.Value = DesiredVal" line with a "You can't assign a value to this object", error #2448. If I comment this line out the code works perfectly, but as I said before it used to work the way I intended with the line.

Can somebody give me a clue how to troubleshoot the problem? It would sure be appreciated!


Last edited by OBBurton; 08-15-2014 at 08:25 AM. Reason: Corrections
OBBurton is offline   Reply With Quote
Old 08-15-2014, 08:36 AM   #2
vbaInet
AWF VIP
 
Join Date: Jan 2010
Location: U.K.
Posts: 26,374
Thanks: 0
Thanked 2,423 Times in 2,389 Posts
vbaInet is a name known to all vbaInet is a name known to all vbaInet is a name known to all vbaInet is a name known to all vbaInet is a name known to all vbaInet is a name known to all
Re: You can't assign a value to this object

You have a "=Date()" or "=Time()" or "=Now()" function in the Control Source of the textbox.
vbaInet is offline   Reply With Quote
The Following User Says Thank You to vbaInet For This Useful Post:
OBBurton (08-15-2014)
Old 08-15-2014, 10:51 AM   #3
OBBurton
Newly Registered User
 
Join Date: Dec 2013
Location: Columbus, Ohio, USA
Posts: 77
Thanks: 76
Thanked 1 Time in 1 Post
OBBurton is on a distinguished road
Re: You can't assign a value to this object

Thanks for the input!
I always have had a Now() in the txtTimeStamp text box and it worked flawlessly until I changed something and your response led me to the culprit. The problem was that the line should have read Forms!frmMain!txtStamp.ControlSource. I have no idea when or why I changed it, but change it I did and now that I have corrected it, it works great!
Thanks again!

OBBurton is offline   Reply With Quote
Old 08-15-2014, 10:59 AM   #4
vbaInet
AWF VIP
 
Join Date: Jan 2010
Location: U.K.
Posts: 26,374
Thanks: 0
Thanked 2,423 Times in 2,389 Posts
vbaInet is a name known to all vbaInet is a name known to all vbaInet is a name known to all vbaInet is a name known to all vbaInet is a name known to all vbaInet is a name known to all
Re: You can't assign a value to this object

That's good to hear!

vbaInet is offline   Reply With Quote
The Following User Says Thank You to vbaInet For This Useful Post:
OBBurton (08-17-2014)
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 forms_are_nightmares Forms 22 02-14-2013 09:19 PM
You can't assign a value to this object abidshahzad4u Forms 1 04-05-2010 09:03 PM
You can't assign a value to this object StuckfromPR Modules & VBA 5 12-24-2008 04:19 AM
Can't assign value to an object BobMcL Forms 1 03-19-2006 08:59 PM
You can't assign a value to this object skwilliams Forms 4 11-03-2003 08:55 AM




All times are GMT -8. The time now is 01:16 AM.


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