date/time auto pop ??

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

can anyone tell me why this code works in one database, but not another??
i've check all the properties in the text boxes and don't see any
differences? it works - but it wont autopopulate instantly like it does in
the database that i got this code from.
thanks,

Private Sub Status_AfterUpdate()
If Me!Status = "Closed" Then
Me!ActualCloseDate = Date
Me!ActualCloseTime = Time
End If


End Sub
 
Tammy said:
can anyone tell me why this code works in one database, but not
another?? i've check all the properties in the text boxes and don't
see any differences? it works - but it wont autopopulate instantly
like it does in the database that i got this code from.
thanks,

Private Sub Status_AfterUpdate()
If Me!Status = "Closed" Then
Me!ActualCloseDate = Date
Me!ActualCloseTime = Time
End If


End Sub

Are the field names exactly the same and are the field types exactly the
same?
 
Hi Tammy,

To add a little to Joseph's answer, make sure that the text box is not named
with a reserved word in Access, specifically Date or Time. That just won't
work.

Problem names and reserved words in Access
http://allenbrowne.com/AppIssueBadWord.html


If you are still having problems, then check for any references marked as
MISSING:

Solving Problems with Library References (Allen Browne)
http://allenbrowne.com/ser-38.html

Access Reference Problems (Doug Steele)
http://www.accessmvp.com/djsteele/AccessReferenceErrors.html


Tom Wickerath
Microsoft Access MVP

http://www.access.qbuilt.com/html/expert_contributors.html
http://www.access.qbuilt.com/html/search.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top