Inserting Dates Doesn't Work

blueBeard

Registered User.
Local time
Today, 12:47
Joined
Jun 19, 2002
Messages
20
I have a form that I want to datestamp. I have tried both the expression builder, and used Insert, Date and Time from the menu. Neither work, and both result in a #Name? error.

I am so confused, cause when I try these methhods on the MS sample db's, they do work. ANY IDEAS WHY MY DB IS SO DARN SPECIAL?!?!

Thanks!
 
Do you want to just show the time on the form or store the date / time in a field. If you want to store the date/time with a record, create a textbox linked to the record and set the default value to =Date() for the date or Now() for the date and time.
If you simply want to display the date on the form and not store it then create a new label named lblToday and on the on load event of the form, select [event procedure], click on the ... then type
me.lblToday.caption = Date() 'for the date or
me.lblToday.caption = Now() 'for the time

HTH
 
I have the EXACT same problem! Only mine is weirder - it worked properly for about 10months, all of a sudden now it just says #name ! I used =date() ...... I really need a fix for this!
 
anyone give more advice on this issue? tried the advice before, to no avail. i just want to display the current date on the form, so that it is date stamped when printed. this should be a very very easy thing to do you would think, but it seems so complicated?!? why doesn't the insert, date just work?!?!?!?! that would be the simplest. any more advice?????
 
go into the design of the table that has the field to store this date.
select the field and make the default value =Date()
when you open the form, the field will then show current date, it will also store that date when the record is saved, so when you go back to the record it will show when the record was created.
 
wh00t, not true in my case. see fizio's comment...i tried that already, still get the #Name error
 
If integral Access functions are not working, the failure is usually caused because of a missing reference. Open any code module. Select Tools/References from the menu. Look for the word "MISSING". Correct the missing reference. There are many posts regarding this problem and it is well explained by articles in the MS knowledge base.
 
Thanks Pat! I just imported my tables, forms, queries, etc... into a new db, and it worked....it reset the Access functions back to what they were supposed to be. My scalp thanks you too (no more pulling my hair out!!!...for now)
 

Users who are viewing this thread

Back
Top Bottom