Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Replace field with system date 1

Status
Not open for further replies.

tadiguma

Technical User
May 4, 2002
8
0
0
PG
I'm new to MS-Access and Visual Basic
I've used Access 2000 and created entry forms and want to replace a date field with the system date when the user clicks the save command.

I've used the following code.

Dim MyDate as Date
MyDate = Date
Forms!frmPersonal!date_ent=MyDate

I get the following error:

Standard Treatment trial can't find the field 'Date' referred to in your expression.
Any help that will solve my problem will be appreciated

Thanks

Thomas
 
Try only a single line without any decalration
Code:
Forms!frmPersonal!date_ent=Date

________________________________________________________
Zameer Abdulla
Help to find Missing people
There’s a world of difference between editorials and advertorials
 
You may have named something date somewhere, if you find something, then rename. In the mean time, try disambiguating, which might work

[tt]Forms!frmPersonal!date_ent = VBA.Date[/tt]

Roy-Vidar
 
Thanks ZMRAbdulla for your tip. I tried this but it didn't work.
Roy-Vidar's solution worked. Thanks for the tip
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top