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!
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: