I NEED TO INSERT EVERY DATE WITHOUT TYPING OVER AND OVER?

M

MISSMIXALOT23

I NEED TO FILL A COLUMN WITH EVERY DATE ASCENDING. HOW DO I DO THAT WITHOUT
HAVING TO TYPE ALL OF THEM?
 
M

Mike Labosh

No disrespect intended, but typing in all caps is considered "SHOUTING", and
is rude.
I NEED TO FILL A COLUMN WITH EVERY DATE ASCENDING. HOW DO I DO THAT
WITHOUT
HAVING TO TYPE ALL OF THEM?

I'm assuming that you mean that you do not want to type the dates. If it is
OK to have your date column represent the current date, you can do this:

1. Open your table in design view
2. Goto your date column
3. Make sure its data type is Date / Time
4. Click the Default Value property down below
5. type: = Date()
6. Save your table

Then, when you enter records either in the datasheet view of the table or in
a form with databound controls, today's date will be the default value in
the field. In case you're interested, in step 5 above, using Now() instead
of Date() will get you the full date and time also.
 
S

Steve Schapel

MISSMIXALOT23,

I would consider getting Excel to help with this. Excel has much more
powerful AutoFill features than Access. I would set up a column of
dates in an Excel sheet, using AutoFill, and then import this into the
Access table. I haven't tried it exactly, but even though sometimes
data types get messed up when transferring data between Excel and
Access, I expect this would work ok.
 
F

fredg

I NEED TO FILL A COLUMN WITH EVERY DATE ASCENDING. HOW DO I DO THAT WITHOUT
HAVING TO TYPE ALL OF THEM?

Please don't use All Caps. It's considered YELLING!

How many dates?
From when?

Add the date field to a table.
Create a Module:

Public Sub FillDates()

Dim db As DAO.Database
Dim Rs As Recordset
Dim intX As Integer
Set db = CurrentDb
Set Rs = db.OpenRecordset("tblName")

With Rs
For intX = 0 To 99
.AddNew
!DateFieldName = Date + intX
.Update
Next
End With

Set db = Nothing
Set rs = Nothing

End Sub

Will fill a Table Field with 100 consecutive dates from the current
date.
 
L

Larissa25

I have to do this all the time, so I cheat. As someone else suggested, this
is probably easier to do in Excel, and then just copy and paste the column
into Access. This is best if you're doing it after the fact (i.e. after you
know all the dates you'll want to enter).
Here's the process:
Open a new document in Excel.
In cell A1, type the earliest date you want entered. Make sure to format the
cell so it shows a date (and time, if needed).
In the next cell down, type "=A1+1" without the quotes and hit enter. The
next day should appear.
Click once on the cell you just typed this in (A2) and hold your mouse in
the lower right corner of the cell until your cursor turns into a black plus
sign. Click and hold, and drag down until you think you have the proper
number of days.

Hope this helps!
 
Top