![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
On a form I want to on load create in SQL records to be added to a table. The records consist of todays date so that is a variant in the |
|
sql and then there isa loop that goes 7 times. I end up with 7 records showing blank date. Code below Private Sub Form_Load() Dim dbs As Database Dim Datenow As Date Dim count As Integer Set dbs = CurrentDb Datenow = Date - 1 count = 0 Do Until count = 7 Datenow = Datenow + 1 ' sql = "INSERT INTO Datestoselect (dates) " & " Values (" & Datenow & ");" Dates = Datenow dbs.Execute ("INSERT INTO Datestoselect (dates) " & " Values (" & Datenow & ");") count = count + 1 Loop End Sub Any ideas ? |
#3
| |||
| |||
|
|
On a form I want to on load create in SQL records to be added to a table. The records consist of todays date so that is a variant in the sql and then there isa loop that goes 7 times. I end up with 7 records showing blank date. Code below Private Sub Form_Load() Dim dbs As Database Dim Datenow As Date Dim count As Integer Set dbs = CurrentDb Datenow = Date - 1 count = 0 Do Until count = 7 Datenow = Datenow + 1 ' sql = "INSERT INTO Datestoselect (dates) " & " Values (" & Datenow & ");" Dates = Datenow dbs.Execute ("INSERT INTO Datestoselect (dates) " & " Values (" & Datenow & ");") count = count + 1 Loop End Sub |
![]() |
| Thread Tools | |
| Display Modes | |
| |