Results 1 to 4 of 4

automatically update after some time.

  1. #1
    shah1419 is offline Novice
    Windows XP Access 2003
    Join Date
    Jan 2013
    Posts
    22

    automatically update after some time.

    i am using access database. my requirements is after every 5 minutes it should check the new entry in table and insert it into new table after every 5 minutes only the new entries.
    please advised.

    Table A
    Stuid Number


    Intime text
    Otime text
    Dated date

    Table B
    Stuid number
    msgto varchar2(30)
    msg varchar2(300)
    send varhar2(1)

  2. #2
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    4,292
    The following is based on you having a good reason form duplicating data, such as copying from linked ODBC tables that you don't have edit rights on.

    You could create a form add a timer event and in the event code, execute any query required to do the updating. I presume this would be an update query. The form can be invisible, and be automatically loaded when the db opens, or if you already have that reserved for another form, that form can open the timer form and make it invisible. For the timer interval, 1000 is one second, so 5 minutes is 300 times that.
    - "doesn't work" is no help. What's happening? Error messages? Where??
    - Use code tags for code/sql. Implement changes in copies of your database.
    Irregardless, ain't no such word as "reoccur".

  3. #3
    shah1419 is offline Novice
    Windows XP Access 2003
    Join Date
    Jan 2013
    Posts
    22
    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

  4. #4
    orange's Avatar
    orange is online now Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    12,964

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 11
    Last Post: 03-27-2018, 10:38 AM
  2. Replies: 1
    Last Post: 05-21-2016, 07:51 AM
  3. Replies: 2
    Last Post: 09-23-2015, 08:02 PM
  4. Replies: 3
    Last Post: 04-09-2013, 12:39 PM
  5. Automatically enter today's date when entering time
    By Szabi in forum Database Design
    Replies: 5
    Last Post: 03-16-2012, 02:50 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Tech Forums: Microsoft Office Forums