Now Function

  • Thread starter Thread starter Susan
  • Start date Start date
S

Susan

I have recently converted from Access 97 to Access 2000.
I have a function that is no longer working, wondering if
anyone has a suggestions.

I have a date time field, that I would like the user to be
able to click a command button Now to be able to insert
current date time stamp. I don't want the field auto
filled just in case there are occasions to enter back-
dated information.

I am currently using.

Private Sub Now_Click()
Me![Open Date/Time] = Now
End Sub

This doesn't work. But I know it worked before. Any
Suggestions?
 
Susan said:
I have recently converted from Access 97 to Access 2000.
I have a function that is no longer working, wondering if
anyone has a suggestions.

I have a date time field, that I would like the user to be
able to click a command button Now to be able to insert
current date time stamp. I don't want the field auto
filled just in case there are occasions to enter back-
dated information.

I am currently using.

Private Sub Now_Click()
Me![Open Date/Time] = Now
End Sub

This doesn't work. But I know it worked before.


This is usually a references problem. Check your references
list (from any code module, Tools - References) to see if
any have gone missing of if they're different from you A97
list.
 
Me![Open Date/Time] = Now

As Marshall says, your immediate problem is almost certainly a broken
reference.

On the other hand, having field names like this is just as certainly going
to break something in the future. Jet and Access are quite unreasonably lax
about allowing characters in field names -- having a space is bad enough,
but a division sign is suicidal! It will not be long before a forgotten
bracket or dot will raise all kind of divide-by-zero, missing function, and
illegal operation errors that can be very hard to track down. And if you
ever get to upsizing to a real database, then you will have a horrid
renaming exercise on your hands.

Just a thought


Tim F
 
Back
Top