The object doesn't contain the automation... timestamp (1 Viewer)

MatthewB

Member
Local time
Today, 05:20
Joined
Mar 30, 2022
Messages
85
I have, [Tasks_T].DateRequested and set the default to Now() to create a timestamp on record creation. THe Tasks_T has a Subform. When I created a new record in the subform.... the error.

How do I fix this error?
Is the object is DateRequested ?
Can I code this instead on the subform?
I thought I could create an expression for the object that creates the record kf_StrataPlan_ID but this did not work.

Thanks
 

June7

AWF VIP
Local time
Today, 04:20
Joined
Mar 9, 2014
Messages
5,475
I've never encountered this issue. Did you Google the topic? There are lots of discussions. If you want to provide db for analysis, follow instructions at bottom of my post.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 07:20
Joined
Feb 28, 2001
Messages
27,194
Is the sub-form linked to its parent through a pair of parent/child linking fields? I.e. is the sub-form intended to fill in a child record based on the record in the main form and do you have the correct properties set to parallel the relationship between parent and child?

ALSO: Are you saying that you try to create the sub-form record BEFORE you create the parent record? If so, I wouldn't have expected that particular error, but let's say that doing it in that order is atypical of normal Access form usage. Creating the child record first potentially creates an orphan, which Access absolutely doesn't like. I might imagine that error if you are creating the parent from the child AND at least one of the fields in the parent is marked "Required=Yes" - but you have nothing for that field. Sometimes Access gives you a bizarre or inexplicable error when it doesn't quite recognize what you are trying to do.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 20:20
Joined
May 7, 2009
Messages
19,248
is your Default Value like:

=Now()
 

MatthewB

Member
Local time
Today, 05:20
Joined
Mar 30, 2022
Messages
85
I've never encountered this issue. Did you Google the topic? There are lots of discussions. If you want to provide db for analysis, follow instructions at bottom of my post.
Okay, thanks. Yes, it would be helpful to provide the DB. I need to pull the confidential info as you say.
 

MatthewB

Member
Local time
Today, 05:20
Joined
Mar 30, 2022
Messages
85
Is the sub-form linked to its parent through a pair of parent/child linking fields? I.e. is the sub-form intended to fill in a child record based on the record in the main form and do you have the correct properties set to parallel the relationship between parent and child?

ALSO: Are you saying that you try to create the sub-form record BEFORE you create the parent record? If so, I wouldn't have expected that particular error, but let's say that doing it in that order is atypical of normal Access form usage. Creating the child record first potentially creates an orphan, which Access absolutely doesn't like. I might imagine that error if you are creating the parent from the child AND at least one of the fields in the parent is marked "Required=Yes" - but you have nothing for that field. Sometimes Access gives you a bizarre or inexplicable error when it doesn't quite recognize what you are trying to do.
All you write is correct and it all works well otherwise. It is only when I assign the default value to the DateRequested field that I see this error. And it is only in the Parent/Child form that this error occurs. When I create a record in the subform (when not nested in a Main form) no error. I am using a combo box to select the kf_ID for the subform.
 

MatthewB

Member
Local time
Today, 05:20
Joined
Mar 30, 2022
Messages
85
is your Default Value like:

=Now()
Yes it is.
All you write is correct and it all works well otherwise. It is only when I assign the default value to the DateRequested field that I see this error. And it is only in the Parent/Child form that this error occurs. When I create a record in the subform (when not nested in a Main form) no error. I am using a combo box to select the kf_ID for the subform.
 

MatthewB

Member
Local time
Today, 05:20
Joined
Mar 30, 2022
Messages
85
I've never encountered this issue. Did you Google the topic? There are lots of discussions. If you want to provide db for analysis, follow instructions at bottom of my post.
Yes I did. I found no examples like mine.
 

MatthewB

Member
Local time
Today, 05:20
Joined
Mar 30, 2022
Messages
85
One suggestion I read seems to suggest not setting the timestamp in the Table, but setting it through a Macro in the subform - OnClick. I will see if I can figure out how to do that.
 

MatthewB

Member
Local time
Today, 05:20
Joined
Mar 30, 2022
Messages
85
Screenshot 2022-07-21 064903.jpg

I tried to write this Macro on my kf_ID combo box to set the value of a field called Timestamp. It did not work. ??
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 07:20
Joined
Feb 28, 2001
Messages
27,194
@MatthewB, PLEASE when you say "Did not work" tell us what it specifically did or didn't do. It's like giving a dog a totally dried and desiccated bone... good tooth exercise but no meat on the bone. Give us at least a LITTLE bit more to chew on, please.

Did you get an error message or did the field in question not get updated or ... something else (specify.) When we try to troubleshoot, the DID NOT WORK comment forces us to ask more questions because we don't yet know enough about what happened to give answers.
 

June7

AWF VIP
Local time
Today, 04:20
Joined
Mar 9, 2014
Messages
5,475
Instead use SetValue. However, to see it in the macro actions list must first click Show All Actions on ribbon. This code really should not be necessary. Need to figure out issue with DefaultValue property.
 

MatthewB

Member
Local time
Today, 05:20
Joined
Mar 30, 2022
Messages
85
@MatthewB, PLEASE when you say "Did not work" tell us what it specifically did or didn't do. It's like giving a dog a totally dried and desiccated bone... good tooth exercise but no meat on the bone. Give us at least a LITTLE bit more to chew on, please.

Did you get an error message or did the field in question not get updated or ... something else (specify.) When we try to troubleshoot, the DID NOT WORK comment forces us to ask more questions because we don't yet know enough about what happened to give answers.
Yes sorry. I got the following. I am trying to set the value of a field. I think this is an object but the is no 'set object value' in the Macro compiler. So I tried 'SetProperty'.
Screenshot 2022-07-21 075520.jpg
 

MatthewB

Member
Local time
Today, 05:20
Joined
Mar 30, 2022
Messages
85
Instead use SetValue. However, to see it in the macro actions list must first click Show All Actions on ribbon. This code really should not be necessary. Need to figure out issue with DefaultValue property.
Okay. I will try send the db but this mean redacting the data. It not like banking info I have but privacy is privacy. Just a lot of work .
 

Gasman

Enthusiastic Amateur
Local time
Today, 13:20
Joined
Sep 21, 2011
Messages
14,320
Copy the structure only, and a little test data.
 

MatthewB

Member
Local time
Today, 05:20
Joined
Mar 30, 2022
Messages
85
Okay, my apologies to all. I think I had created a macro to set the property, but the table default Now() did this - it set the timestamp. So I had a completely purposeless macro. I deleted it. Error no more.
 

Users who are viewing this thread

Top Bottom