M
Michelle
Using access, I am partway through creating a database.
HOwever, one of my forms requires start and stop times on each job logged
and I have done something in the code as per below. Can you please tell me
where I went wrong - assumed I could modify the code I was given earlier for
the log on screen but obviously not.
code is as follows: [not sure of what the acontrol should be either - any
help appreciated]
Option Explicit
Dim dteStartJob As Date
dteStartJob = Now
cmdStopJob.Visible = True
[AControl].SetFocus
cmdStartJob.Visible = False
Dim strSQL As String
strSQL = "Insert into tblJobTimes(TimeStartJob, TimeStopJob)Values (#" &
dteStartJob & "#,#" & Now & "#);"
CurrentDb.Execute strSQL, dbFailOnError
cmdStartJob.Visible = True
[AControl].SetFocus
cmdStopJob.Visible = False
Option Compare Database
HOwever, one of my forms requires start and stop times on each job logged
and I have done something in the code as per below. Can you please tell me
where I went wrong - assumed I could modify the code I was given earlier for
the log on screen but obviously not.
code is as follows: [not sure of what the acontrol should be either - any
help appreciated]
Option Explicit
Dim dteStartJob As Date
dteStartJob = Now
cmdStopJob.Visible = True
[AControl].SetFocus
cmdStartJob.Visible = False
Dim strSQL As String
strSQL = "Insert into tblJobTimes(TimeStartJob, TimeStopJob)Values (#" &
dteStartJob & "#,#" & Now & "#);"
CurrentDb.Execute strSQL, dbFailOnError
cmdStartJob.Visible = True
[AControl].SetFocus
cmdStopJob.Visible = False
Option Compare Database