date data type

G

Guest

I have a date field in my table, called inductiondate, which is set as short
date. The user will be keying several records in per day, all with the same
date (Not the current day). I want to store the first date they enter and
automatically display it on each add new screen.
I have called the date storedate (dim storedate as date), but when I try to
put storedate into the induction date field on my form, I get the followong
error:-
RunTimeError
-2147352567(800220009) You can't assign a value to this object.
Can anybody help?

TIA
 
A

Al Camp

Make the latest entry into InductionDate the Default value.
Use the AfterUpdate event of InductionDate...

Private Sub InductionDate_AfterUpdate()
InductionDate.DefaultValue = "#" & InductionDate & "#"
End Sub

Let's say you enter 2/20/06 in Induction date. When you open a new
record, that date will be entered into InductionDate by default, and will
cointinue to do so until you overwrite InductionDate with a new value.
 

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

Top