Automatic Date and Time

Hellfire

Registered User.
Local time
Today, 14:51
Joined
Jul 23, 2002
Messages
57
Hi All,

I have a field on one of my forms called Status. It is a combo-box with 3 option, Awaiting Collection, Collected and Cancelled. When a new record is entered, the status is usually Awaiting Collection, it later changes to collected.

I want the time to be recorded when this change happens. I have the followwing script in the After Update field:


Private Sub Status_out_AfterUpdate()
If Me.Status_out = "Collected" Then
Me.Collection Tme_out = Now()
End If
End Sub


The status field on my form is called Status_out
The Field for the Collection Time is called Collection Tme_out

What am I doing wrong? When the status is changed it says: Compile error, Method or member not found.

Please help.
 
That looks pretty much as I would use it. It may be worth checking your vb refrences, and I'm not a fan of leaving spaces in field names i.e. Me.Collection Tme_out I would change to Me.Collection_Tme_out. It may be worth checking this in your code.

HTH
John
 
H,

Good code -- but you may have unwittingly used an VBA object keyword (Collection).

You can test this by filling the space with an underscore:

Change the field name Collection Tme_out to Collection_Tme_out
and the code that refers to it -- Me.Collection Tme_out = Now() --to Me.Collection_Tme_out = Now() and hopefully things will work as they should.

Regards,
Tim
 

Users who are viewing this thread

Back
Top Bottom