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