Code:
Private Sub USERID_AfterUpdate()On Error GoTo ErrorHandler
DoCmd.SetWarnings False
Dim StrSQl As String
StrSQl = "Insert into MsgOut (id,msg,send,msgto) "
StrSQl = StrSQl & "SELECT [STUDENT].[GR No], ' Inout Ho Gya Hay:::DAR-E-ARQAM SCHOOL. ', True , [STUDENT].[Mobile] "
StrSQl = StrSQl & "FROM [STUDENT] " & _
"WHERE [STUDENT].[STATUS]='Active' " & _
"and userid=[gr no]"
' CurrentDb.Execute StrSQl, dbFailOnError
DoCmd.RunSQL (StrSQl)
ExitHandler:
DoCmd.SetWarnings True
Exit Sub
ErrorHandler:
MsgBox Err.Number & Chr(13) & Err.Description
Resume ExitHandler
End Sub
i am using this code in after update event. it working fine .
but i want to it will check in every 5 minutes the new data between the 5 minutes automatically insert into new table-B.
i have set the time interval=1000