Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Private Sub TestQueryRun()
Dim db as DAO.Database
Dim rs as DAO.Recordset
Set db = CurrentDb
Set rs = db.OpenRecordset("tblMyHistoryTable")
rs.AddNew
rs.Fields("StartDate") = Now()
rs.Update
DoCmd.OpenQuery "qryMyQuery"
rs.Edit
rs.Fields("EndDate") = Now()
rs.Update
rs.Close
Set rs = Nothing
db.Close
Set db = Nothing
End Sub
[blue]Public Declare Function timeGetTime Lib "winmm.dll" () As Long[/blue]
[blue] Dim db As DAO.Database, StartTime As Long, EndTime As Long
Set db = CurrentDb
StartTime = [purple][b]timeGetTime[/b][/purple]
db.Execute "DELETE tblLottoNumbers.* " & _
"FROM tblLottoNumbers;", dbFailOnError
db.Execute "INSERT INTO tblLottoNumbers (Num) " & _
"SELECT qryDayN.Dy " & _
"FROM qryDayN;", dbFailOnError
db.Execute "INSERT INTO tblLottoNumbers (Num) " & _
"SELECT qryYearN.Expr1 " & _
"FROM qryYearN;", dbFailOnError
EndTime = [purple][b]timeGetTime[/b][/purple]
Debug.Print EndTime - StartTime & " milliseconds"[/blue]