PC Review


Reply
Thread Tools Rate Thread

autofill previous date

 
 
Gary
Guest
Posts: n/a
 
      23rd Jan 2008
I have numerous records to enter using the same date on a form. (it is not
the current date and it will change) I don't want to retype the same date for
each record. I am very new to access and have tried several suggestions but
they haven't worked. My field is called Date.
 
Reply With Quote
 
 
 
 
Jeanette Cunningham
Guest
Posts: n/a
 
      23rd Jan 2008
Gary,
The name of your field is probably the reason that the suggestions you tried
didn't work.
Date is a reserved word that has special meaning in Access and shouldn't be
used for a field name.
Rename it to something like OrderDate, AssessmentDate, CallDate or similar.
For a date field the default value is written like this:

Private Sub TxtTheDate_AfterUpdate()
If Not IsNull(Me.TxtTheDate) Then
Me.TxtTheDate.DefaultValue ="#" & Me.TxtTheDate & "#"
End If
End Sub

Replace TxtTheDate with the name of the textbox control for your date field.

Jeanette Cunningham

"Gary" <(E-Mail Removed)> wrote in message
news:70702176-FE08-447C-A227-(E-Mail Removed)...
>I have numerous records to enter using the same date on a form. (it is not
> the current date and it will change) I don't want to retype the same date
> for
> each record. I am very new to access and have tried several suggestions
> but
> they haven't worked. My field is called Date.



 
Reply With Quote
 
 
 
 
Klatuu
Guest
Posts: n/a
 
      23rd Jan 2008
In the After Update event of the date control:

Me.MyDateControl.DefaultValue = Me.MyDateControl


--
Dave Hargis, Microsoft Access MVP


"Gary" wrote:

> I have numerous records to enter using the same date on a form. (it is not
> the current date and it will change) I don't want to retype the same date for
> each record. I am very new to access and have tried several suggestions but
> they haven't worked. My field is called Date.

 
Reply With Quote
 
Gary
Guest
Posts: n/a
 
      23rd Jan 2008
Thank you, changing the name did it, this puts in the date in a new record in
the form but gets stuck and won't continue on to another record (the new
record button is greyed out too.

"Jeanette Cunningham" wrote:

> Gary,
> The name of your field is probably the reason that the suggestions you tried
> didn't work.
> Date is a reserved word that has special meaning in Access and shouldn't be
> used for a field name.
> Rename it to something like OrderDate, AssessmentDate, CallDate or similar.
> For a date field the default value is written like this:
>
> Private Sub TxtTheDate_AfterUpdate()
> If Not IsNull(Me.TxtTheDate) Then
> Me.TxtTheDate.DefaultValue ="#" & Me.TxtTheDate & "#"
> End If
> End Sub
>
> Replace TxtTheDate with the name of the textbox control for your date field.
>
> Jeanette Cunningham
>
> "Gary" <(E-Mail Removed)> wrote in message
> news:70702176-FE08-447C-A227-(E-Mail Removed)...
> >I have numerous records to enter using the same date on a form. (it is not
> > the current date and it will change) I don't want to retype the same date
> > for
> > each record. I am very new to access and have tried several suggestions
> > but
> > they haven't worked. My field is called Date.

>
>
>

 
Reply With Quote
 
Gary
Guest
Posts: n/a
 
      23rd Jan 2008
Never mind. I found my problem. Thank you so much for your time and expert
advice.
Take Care

"Gary" wrote:

> Thank you, changing the name did it, this puts in the date in a new record in
> the form but gets stuck and won't continue on to another record (the new
> record button is greyed out too.
>
> "Jeanette Cunningham" wrote:
>
> > Gary,
> > The name of your field is probably the reason that the suggestions you tried
> > didn't work.
> > Date is a reserved word that has special meaning in Access and shouldn't be
> > used for a field name.
> > Rename it to something like OrderDate, AssessmentDate, CallDate or similar.
> > For a date field the default value is written like this:
> >
> > Private Sub TxtTheDate_AfterUpdate()
> > If Not IsNull(Me.TxtTheDate) Then
> > Me.TxtTheDate.DefaultValue ="#" & Me.TxtTheDate & "#"
> > End If
> > End Sub
> >
> > Replace TxtTheDate with the name of the textbox control for your date field.
> >
> > Jeanette Cunningham
> >
> > "Gary" <(E-Mail Removed)> wrote in message
> > news:70702176-FE08-447C-A227-(E-Mail Removed)...
> > >I have numerous records to enter using the same date on a form. (it is not
> > > the current date and it will change) I don't want to retype the same date
> > > for
> > > each record. I am very new to access and have tried several suggestions
> > > but
> > > they haven't worked. My field is called Date.

> >
> >
> >

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Outlook AutoFill Delete one autofill entry only katr52@yahoo.com Microsoft Outlook Discussion 4 5th Oct 2006 10:37 PM
Autofill: Need to autofill one week block, (5) weekday only into cells. dstock Microsoft Excel Misc 1 17th Jun 2005 08:21 PM
Q. Autofill question: Can I autofill alpha characters like I can numbers? George Microsoft Excel Programming 5 7th Aug 2004 10:33 AM
Macro that will autofill a column with data, up to the last row of data in previous c Max Velocity Microsoft Excel Programming 4 27th Nov 2003 11:34 AM
Autofill value from previous record Tom Microsoft Access Forms 2 3rd Nov 2003 08:01 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:25 PM.