View Single Post
Old 03-23-2019, 08:31 AM   #1
deltekkie
Newly Registered User
 
Join Date: Mar 2019
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
deltekkie is on a distinguished road
can't assign a value to this object

Hello,

I have a table that I am convert over for Excel which my group uses to track their work progress. I have created three particular fields in this table and linked a form to this table where they actually input the information. They input a start time and a stop time. I have three unbound text boxes as an experiment to test the VB math functions.

Table has
txtStartTime set to date/time
txtStopTime set to date/time
txtTimeSpent set to Short Text

Form has
table txtStartTime set to plain text bound to table StartTime
user will input this value

table txtStopTime set to plain text bound to table StopTime
user will input this value

table txtTimeSpent set to plain text bound to table TimeSpent
will receive value from calc2

txtCalcBox set to plain text is unbound
DayCalc set to plain text is unbound
calc2 set to plain text is unbound

This code will run
Me.txtCalcBox.Value = Me.txtStopTime.Value - Me.txtStartTime.Value
Me.DayCalc.Value = (Me.txtCalcBox.Value) Mod 24
Me.calc2 = Me.DayCalc & " Days " & Me.txtCalcBox
Me.txtTimeSpent = Me.calc2

every time
the form is opened
OR
tbStartTime is updated
OR
tbStopTime is updated

The first three work just fine. The last one throws the error.

I have tried many iterations of the last line and none work
examples:
Me.txtTimeSpent = Me.calc2
Me.txtTimeSpent.Value = Me.calc2.Value
Me!txtTimeSpent = Me!calc2
Me![txtTimeSpent] = Me![calc2]
Me![txtTimeSpent].Value = Me![calc2].Value
Me.[txtTimeSpent].Value = Me.[calc2].Value

Can anyone tell me what I am doing wrong?

Thank you!

deltekkie is offline   Reply With Quote