Ok, hope I can get some help on this. I want to programmatically add new records maybe in MS Access Module. I would like to see a sample in the simplest form such as adding a new record for each day of the week for the entire year to an existing table. The new record can consist of ID (auto number) and Date. So the first few records in the table would look like this:
The module would loop until it hits Dec 31/2004. If I can get a sample, I can maybe alter it to reflect my actual data.
Ok, figured this one out. I just used the Module in Access and did some VB ADO to add new records. I also did not want to add weekends so I set my dates and checked for what day it was and if Sat, add 48 hours or if Sun. add 24 hours. If statements jump over weekends instead of adding to my table. Works well. Now I can add all employees standard Mon to Fri hours for the entire year in a matter of seconds....
Dim rst As ADODB.Recordset
Dim strSQL As String
Dim dteI As Date
Set rst = New ADODB.Recordset
strSQL = "SELECT * FROM MyTable"
rst.Open strSQL, CurrentProject.Connection, adOpenKeyset, adLockPessimistic
dteI = Date
Do Until dteI = #12/31/2004#
.Fields("myDate") = dteI
dteI = DateAdd("d", 1, dteI)
Set rst = Nothing
Haven't checked this but it is about correct. Using ADO recordset.