Quick data entry

nhood42

New member
Local time
Yesterday, 18:42
Joined
May 19, 2016
Messages
1
Without copy/pasting, how can I enter the same date in multiple rows(50-100 consecutive). Also multiple dates are in the same table.
Thanks
 
Hi nhood42

With a VBA program but what do you mean by "enter"? Add or update records?

For adding records with the same date, call this code on click event button

Code:
sDate ="#07/25/2016#"
For i to 100
   sqlINSERT = "INSERT INTO tableName ( field) VALUES (" & sDate & ")"
   DoCmd.RunSQL = sqlINSERT 
next i
 
Last edited:
More like

Code:
Dim sDate As String
Dim i As Long
Dim sqlINSERT As String
sDate = "#7/25/2016#"
sqlINSERT = "INSERT INTO tableName ( field) VALUES (" & sDate & ")"
For i = 1 To 100
    DoCmd.RunSQL sqlINSERT
Next i
 

Users who are viewing this thread

Back
Top Bottom