HAMMAMABUARQOUB
Registered User.
- Local time
- Today, 13:38
- Joined
- Jul 29, 2009
- Messages
- 75
Idea for Filling Data automaticly using a Timer()
Again,, back with a new tip for developers.. specially who use timers and automation ... and you will learn below that it can be used for monitoring and security...
this is the code:
How to use:
simply.. create the table with the name t1 and sec, min, hr , and notes field or username field or inventory item or,, whatever
creat a form ,name it as here times
creat the labels,, s, m, and h .. and also remember lable3 for displaying the record added msg on the form just to inform the user instead of having to display the "you are about to....etct" default bu access action queries,,,note,, here helps the "setwarnings false " command,,,,
we are not done yet,,
past the code in the form..as it is here...note that it can be upgraded or updated or developed by anyone who wants more options,, like
controlling the time after which you wanna add records,, or even more,,
EXAMPLE INCLUDED...
bye bye!!!
tell me what you think.. any feedback is wellcomed
HAMMAM ABUARQOUB
Again,, back with a new tip for developers.. specially who use timers and automation ... and you will learn below that it can be used for monitoring and security...
this is the code:
Code:
Private Sub Form_Timer()
Me.s.Caption = Second(Time())
Me.m.Caption = Minute(Time)
Me.h.Caption = Hour(Time())
If Val(Me.m.Caption) = 5 Or Val(Me.s.Caption) = 59 Then
Me.Label3.Visible = Not Me.Label3.Visible
DoCmd.SetWarnings False
DoCmd.RunSQL "INSERT INTO t1 ( Sec, [Min], Hr )SELECT Val(Forms!times!s.Caption) AS sss, Val([Forms]![times]![m].[Caption]) AS mmm, Val([Forms]![times]![h].[Caption]) AS hhh"
Else
Me.Label3.Visible = False
End If
End Sub
simply.. create the table with the name t1 and sec, min, hr , and notes field or username field or inventory item or,, whatever
creat a form ,name it as here times
creat the labels,, s, m, and h .. and also remember lable3 for displaying the record added msg on the form just to inform the user instead of having to display the "you are about to....etct" default bu access action queries,,,note,, here helps the "setwarnings false " command,,,,
we are not done yet,,
past the code in the form..as it is here...note that it can be upgraded or updated or developed by anyone who wants more options,, like
controlling the time after which you wanna add records,, or even more,,
EXAMPLE INCLUDED...
bye bye!!!
tell me what you think.. any feedback is wellcomed
HAMMAM ABUARQOUB
Attachments
Last edited: