Countdown timer on form

I have prepared a online test application over ms access. 

Can this be done?
When the user login & starts the test, a countdown timer for 30 minutes 
starts on top of form and automatically closes the form once the time is over.

I am new to coding macros, this function is important for me. Kindly help..

thanks a lot.. 
Boss
0
Utf
11/28/2007 3:30:01 PM
access 16762 articles. 2 followers. Follow

4 Replies
3964 Views

Similar Articles

[PageSpeed] 37

To answer the question of whether a time interval can be set to close a form: 
Yes, this can be done.  Look in Help for the On Timer event.  This would need 
to be set up in vba.  As far as I know there are no macros for this per se.  
Open your form in design view and select it's properties.  Go to the Event 
Tab; there is a property for both On Timer and Time Interval (measured in 
miliseconds - 1000 = 1 second, 60000 = 1 minute, 1800000 = half an hour).  
First type in your Time Interval, then click on the "..." button next to the 
On Timer line, opt to use the code builder and type in the following code, 
replacing the words FormName with the name of your form, but leaving the 
quotes there:

DoCmd.Close acForm, "FormName"

However, as far as I know, you cannot use MS Access Forms/Reports or their 
associated events (both VBA and macros) online. 

Also, while I've read about a few exceptions, almost all information I have 
seen/heard/happened upon indicate that JET, the database engine that MS 
Access uses, is not really geared for use on a web server.  If this is your 
end goal, you may want to look into SQL Server.

Hope this information helps.
Tim

"Boss" wrote:

> I have prepared a online test application over ms access. 
> 
> Can this be done?
> When the user login & starts the test, a countdown timer for 30 minutes 
> starts on top of form and automatically closes the form once the time is over.
> 
> I am new to coding macros, this function is important for me. Kindly help..
> 
> thanks a lot.. 
> Boss
0
Utf
11/28/2007 4:13:02 PM
This was great.. Hats-off to you..
I was busy doing bit of coding for this but failed. U found it on teh 
property tab.

Extension to this, which is my prime aim is to display a countdown on the 
form so that the user knows how much time is left. 
Could u help me over this?
My database is online means i have shared the database on the shared drive.

Thanks a lot..
Boss 

"Tim Johnson" wrote:

> To answer the question of whether a time interval can be set to close a form: 
> Yes, this can be done.  Look in Help for the On Timer event.  This would need 
> to be set up in vba.  As far as I know there are no macros for this per se.  
> Open your form in design view and select it's properties.  Go to the Event 
> Tab; there is a property for both On Timer and Time Interval (measured in 
> miliseconds - 1000 = 1 second, 60000 = 1 minute, 1800000 = half an hour).  
> First type in your Time Interval, then click on the "..." button next to the 
> On Timer line, opt to use the code builder and type in the following code, 
> replacing the words FormName with the name of your form, but leaving the 
> quotes there:
> 
> DoCmd.Close acForm, "FormName"
> 
> However, as far as I know, you cannot use MS Access Forms/Reports or their 
> associated events (both VBA and macros) online. 
> 
> Also, while I've read about a few exceptions, almost all information I have 
> seen/heard/happened upon indicate that JET, the database engine that MS 
> Access uses, is not really geared for use on a web server.  If this is your 
> end goal, you may want to look into SQL Server.
> 
> Hope this information helps.
> Tim
> 
> "Boss" wrote:
> 
> > I have prepared a online test application over ms access. 
> > 
> > Can this be done?
> > When the user login & starts the test, a countdown timer for 30 minutes 
> > starts on top of form and automatically closes the form once the time is over.
> > 
> > I am new to coding macros, this function is important for me. Kindly help..
> > 
> > thanks a lot.. 
> > Boss
0
Utf
11/28/2007 5:09:01 PM
Hi

Create a new text box on your form - call it timer
set the default value to 10 (just for now)

Set the form's timer interval to 1000

Put this code on the form's On Timer event


Private Sub Form_Timer()
If Me.Timer = 0 Then
    DoCmd.Close
    Else
    Me.Timer = Me.Timer - 1
End If
End Sub

Have a look at it then alter the code and timer interval to what you need.
You don't need to use DoCmd.Close - you can put a message box or open 
another form or whatever here in the code

good luck


-- 
Wayne
Manchester, England.



"Boss" wrote:

> This was great.. Hats-off to you..
> I was busy doing bit of coding for this but failed. U found it on teh 
> property tab.
> 
> Extension to this, which is my prime aim is to display a countdown on the 
> form so that the user knows how much time is left. 
> Could u help me over this?
> My database is online means i have shared the database on the shared drive.
> 
> Thanks a lot..
> Boss 
> 
> "Tim Johnson" wrote:
> 
> > To answer the question of whether a time interval can be set to close a form: 
> > Yes, this can be done.  Look in Help for the On Timer event.  This would need 
> > to be set up in vba.  As far as I know there are no macros for this per se.  
> > Open your form in design view and select it's properties.  Go to the Event 
> > Tab; there is a property for both On Timer and Time Interval (measured in 
> > miliseconds - 1000 = 1 second, 60000 = 1 minute, 1800000 = half an hour).  
> > First type in your Time Interval, then click on the "..." button next to the 
> > On Timer line, opt to use the code builder and type in the following code, 
> > replacing the words FormName with the name of your form, but leaving the 
> > quotes there:
> > 
> > DoCmd.Close acForm, "FormName"
> > 
> > However, as far as I know, you cannot use MS Access Forms/Reports or their 
> > associated events (both VBA and macros) online. 
> > 
> > Also, while I've read about a few exceptions, almost all information I have 
> > seen/heard/happened upon indicate that JET, the database engine that MS 
> > Access uses, is not really geared for use on a web server.  If this is your 
> > end goal, you may want to look into SQL Server.
> > 
> > Hope this information helps.
> > Tim
> > 
> > "Boss" wrote:
> > 
> > > I have prepared a online test application over ms access. 
> > > 
> > > Can this be done?
> > > When the user login & starts the test, a countdown timer for 30 minutes 
> > > starts on top of form and automatically closes the form once the time is over.
> > > 
> > > I am new to coding macros, this function is important for me. Kindly help..
> > > 
> > > thanks a lot.. 
> > > Boss
0
Utf
11/28/2007 6:09:02 PM
put a label called time_left on your form and set the timer interval to 1000. 
 Then insert the following code:

Private Sub Form_Timer()
   Call tick_timer(False)
End Sub

Private Sub Form_Open(Cancel As Integer)
   Call tick_timer(True)
End Sub

Sub tick_timer(Optional reset As Boolean)
    Dim x As Variant
    Static end_time As Date
    
    If reset Then
       end_time = DateAdd("n", 30, Now())
    End If
    
    Me.Label3.Caption = end_time
    x = Int(DateDiff("s", Now(), end_time) / 60)
    x = x & ":" & Right("0" & DateDiff("s", Now(), end_time) Mod 60, 2)
    
    Me.Label1.Caption = x
End Sub

"Boss" wrote:

> This was great.. Hats-off to you..
> I was busy doing bit of coding for this but failed. U found it on teh 
> property tab.
> 
> Extension to this, which is my prime aim is to display a countdown on the 
> form so that the user knows how much time is left. 
> Could u help me over this?
> My database is online means i have shared the database on the shared drive.
> 
> Thanks a lot..
> Boss 
> 
> "Tim Johnson" wrote:
> 
> > To answer the question of whether a time interval can be set to close a form: 
> > Yes, this can be done.  Look in Help for the On Timer event.  This would need 
> > to be set up in vba.  As far as I know there are no macros for this per se.  
> > Open your form in design view and select it's properties.  Go to the Event 
> > Tab; there is a property for both On Timer and Time Interval (measured in 
> > miliseconds - 1000 = 1 second, 60000 = 1 minute, 1800000 = half an hour).  
> > First type in your Time Interval, then click on the "..." button next to the 
> > On Timer line, opt to use the code builder and type in the following code, 
> > replacing the words FormName with the name of your form, but leaving the 
> > quotes there:
> > 
> > DoCmd.Close acForm, "FormName"
> > 
> > However, as far as I know, you cannot use MS Access Forms/Reports or their 
> > associated events (both VBA and macros) online. 
> > 
> > Also, while I've read about a few exceptions, almost all information I have 
> > seen/heard/happened upon indicate that JET, the database engine that MS 
> > Access uses, is not really geared for use on a web server.  If this is your 
> > end goal, you may want to look into SQL Server.
> > 
> > Hope this information helps.
> > Tim
> > 
> > "Boss" wrote:
> > 
> > > I have prepared a online test application over ms access. 
> > > 
> > > Can this be done?
> > > When the user login & starts the test, a countdown timer for 30 minutes 
> > > starts on top of form and automatically closes the form once the time is over.
> > > 
> > > I am new to coding macros, this function is important for me. Kindly help..
> > > 
> > > thanks a lot.. 
> > > Boss
0
Utf
11/28/2007 6:37:02 PM
Reply:

Similar Artilces:

How to set a form in dialog mode??
Hi all, I have a form that shows a combo box. This form is launched by a piece of code from another form. The VBA code needs to wait that the form has closed befor continuing, having catch the user selection. I know how to open the form in dialog mode, using docmd.OpenForm, formname,,,,,acDialog. However I start the form by instanciating a form object, like: Dim frm As Form_myForm Set frm As new Form_myForm How can I set the form in dialog mode, so that the code waits until the form closes? TIA, Philippe can't you put the part of the code that needs to wait in the on close event ...

Outlook Task (request form)
Hi there, I am hoping that someone out there knows the answer to my guestion! I am creating a customized task request form that eventually will sit on every users desktop in the school district where I work. My goal is to have the users enter a request for technical assistance that generates an email to each of the 4 technology members here. The e-mail will generate a task item when accepted and send a reply to the "owner" (staff member initiating the request). The problem I'm encountering is when I customize the form and turn off the display of the default task page, m...

Forms
I am currently teaching publisher. My students are creating forms with the controls. The form looks fine, but when they re-open the form, we find that the controls have moved all over the page. Suggestions? ...

queries / forms/ report
I have a query for every month of the year and a report that has all 12 months on that report. What I would like to be able to do is to have one query and show each month on the report, but i would also like to able to input the time span that the query should calculate. I hope this make sense. Please let me know if this needs for explination. Thanks for your time. On Mon, 11 Feb 2008 10:16:00 -0800, Erik <Erik@discussions.microsoft.com> wrote: >I have a query for every month of the year and a report that has all 12 >months on that report. What I would like to be able to d...

timers and WaitForSingleObject
I'm getting ready, for the first time, to use CEvent and WaitForSingleObject, particularly with my audio. Nevertheless, I thought I'd fish for a comment or two on the use of timers. At this point, I have some pretty nice things going on, based on timers and pretty much the same code I will have when I convert to WaitForSingleObject. My audio is especially time sensitive, and the timers are so well coordinated and integrated with the rest of the code that I can't see my program actually faring any better when I replace them. Should I possibly keep things the way they are? Ess...

create an expense requisition form
Can you please help me to learn how to create an expense requisition form? thanks, ml Being by looking here: http://office.microsoft.com/en-us/templates/FX100595491033.aspx -- Gary''s Student - gsnu201003 "desesperada123" wrote: > Can you please help me to learn how to create an expense requisition form? > thanks, > ml You could start by browsing the MS Template Gallery http://officeupdate.microsoft.com/templategallery/default.asp Search for "expense" or "requisition" Gord Dibben MS Excel MVP On Fri, 14 May 2...

Creating a form -
Hi would anyone steer me in the right direction please. I do not have access, only Microsoft exel 2003 I have followed the threats on how to create a form, but will require it modified slightly. (g). Not enough information here to hazard a guess. Please provide a few details on what type of form and slight modifications required. Maybe even a message ID of the threads you followed? Gord Dibben MS Excel MVP On Tue, 24 Nov 2009 14:50:54 GMT, "BNT1 via OfficeKB.com" <u19326@uwe> wrote: >Hi > >would anyone steer me in the right direction pl...

Subform
I should know how to do this, but I dont. When I open my form the main field that everything links to is empy, but the other field have data from the first record. How do I get it to open so that all of the fields are blank and will update once the drop down box has a record chosen? there is a subform and one record in the main form that need to kept in sync with the drop down box. Thanks You can set the recordsource of the form to "SELECT * FROM SomeTable WHERE False" Then in the afterupdate of the combo set the recordsource to "SELECT * FROM SomeTable WHERE Whatever ...

chart on the form
Is it possible to have chart controls on the form? I would like to have Excel chart like bare, pie, line chart on the form base on the data in the table. Is it possible to do this? If yes, any controls or activeX controls available for Access? Your information is great appreciated, Use Pivot Chart view and select pivot chart on form properties. Damon "Souris" <Souris@discussions.microsoft.com> wrote in message news:40472F3E-CA90-4D7A-9FBB-75F89078CBD5@microsoft.com... > Is it possible to have chart controls on the form? > > I would like to have Excel chart like...

Grouping Form Fields on Continuous Form
Hi, I have a table which looks somewhat like this: --------------------------- | Type | Name | Value | --------------------------- | A | Ball | 1.00 | | A | Cup | 2.00 | | B | Fly | 0.50 | (...and so on) I want these displayed on a form, however, grouped by Type (similar to a report), for example Type: A Ball [Textbox] Cup [Textbox] Type: B Fly [Textbox] Is such a thing possible? The closest I can get is with multiple labels and conditional formatting. Code seems to be of little us...

Report with buttons to open specific form for each record
Is it possible to have a report that is based on a query (which is based on numerous other queries) to have a button that opens a specific form for each record on the report? I would like for the user to be able to select an appropriate button which corresponds to a form based on the results showing on the report. Thanks. -- Donna N. ...

Form help
We are in the process of creating a computer with a kiosk type software that guests need to sign into. There will be a form that they need to complete. We need to be able to make it so that the guest can search for the name of the person he is visiting and then the form will be emailed to that specific person. Is there a way to make a form that works with our exchange server so it searches for a name and then automatically sets the form to email to him. Sure. The form would have to look the user up in Active Directory based on whatever search criteria you have in mind. -- Ed Crowley MVP...

Printing Issues when distributing a form to multiple users
I am distributing a spreadsheet to multiple users. The spreadsheet is being used as a form for data entry. The problem i am having is that when it is being printed, the users are getting varying page layouts where the page breaks have changed, due the changes to the length of the document growing from the free text they are entering. The page breaks that excel chooses don't seem to be spaced well, leading to one or two of the pages being very short (i.e., leaving a lot of free white space), whereas the other pages are taking up the entire page. Is there a particular page layout selection...

Update Queries don't work in form
I have a form with queries that update several fields to null. I split the database with the splitter in access and placed the backend ( the Tables) on a server running XP and the Front end ( Queries and Forms) on a work station running Vista. Now I go to run a query I get the message "Operation must use an Updateable Query" I pressed the Help Button and the only things applicable were the item dealing with permissions I checked them on both the FrontEnd and BackEnd and I have full control permissions for both. I even created a new Update Query and it doesn't work. Anyon...

Quick Create Forms
I am fairly new to MSCRM. We have modified the lead form but this does not appear to modify the Quick Create Lead form. Is this by design?. Can the Quick Create Forms be modified...if not can the Quick Create dropdown list be turned off so that staff only use the modified forms? Dear Jim, The quick create does only show required fields. That means that if you modify the form to have more required fields, then these fields will be visible as well. You can set this option at the properties screen while modifying the form. With kind regards, Ronald Lemmen Avanade Netherlands "Jim...

Organizational Forms library #3
I followed the article http://support.microsoft.com/default.aspx?scid=kb;en-us;244591&sd=tech in order to create a organizational forms library in Exchange Now if I try to delete the created folder, I can't, and I get the error c1030af1 although I've administrator permissions.. Why can't I delete this folder Thank Regis ...

Countdown
Is there anyway to do a time countdown in Excel? Like take todays date and time and take the date and time of 3 weeks from now and do a countdown. Thanks. Aaron FaultlessCaster Division MIS =<your value here>-TODAY() format cell "general" for result -- "Aaron Russell" <arussell@faultlesscaster.com> wrote in message news:eQAJIuhhEHA.1568@TK2MSFTNGP09.phx.gbl... > Is there anyway to do a time countdown in Excel? Like take todays date and > time and take the date and time of 3 weeks from now and do a countdown. > Thanks. > > Aaron > > ...

Timer Count Down
Hello, Is there a way of placing a timer on a form that, when the start button is clicked it will start counting down from a specified time? Example: Say I click the button and it starts to count down, I want the timer displayed to show people how much time is left to bid on an item. This way, when everyone opens the database it will always show the current countdown time and not refresh itself. Say a count down time of 2 days? Is this possible? Thanks!! Forms in Access have a built-in Timer object. To activate it, you set the form's TimerInterval to the number of milliseconds y...

Where are auto-complete values stored in browser forms
My browsers (IE and Firefox) keep values of auto-complete for form fields (eg what I've entered for Google searches in the past). Where is this kept? How do I find all the lists for the different kinds of fields that kept in my PC? Not an Office's Outlook question. Ask in a Windows forum. "Hall" wrote: > My browsers (IE and Firefox) keep values of auto-complete for form fields > (eg what I've entered for Google searches in the past). > > Where is this kept? How do I find all the lists for the different kinds of > fields that kept in my PC? &g...

Controling navagation of a form
created a form in excel. How do I make it so the client completing the form can tab through only the cells requiring them to enter information? As it is now when you hit tab key you move to cells that are background in the form Read up on protected cells and forms. When you protect the form, all cells are protected. You'll need to unprotect the cells you want users to enter information on. If you have 2003, there is a Protection toolbar that is very handy to use when you unprotect. Carole O "Amanda" wrote: > created a form in excel. How do I make it so the client ...

Tab order
Does anyone know how to set the tab order on a form? Thanks you can select the tab - and use the green arrows on the right to move them back and forth... "Joe" <anonymous@discussions.microsoft.com> wrote in message news:70ff01c3e773$db61a250$a101280a@phx.gbl... > Does anyone know how to set the tab order on a form? > > Thanks Sorry, I meant the order in which you could tab through the fields on the form. >-----Original Message----- >you can select the tab - and use the green arrows on the right to move them >back and forth... > >"Joe" ...

Font Size in Forms Combo Box
Is there any way to increase the font size of the displayed data in th forms Combo Box?? Et3rna -- Et3rna ----------------------------------------------------------------------- Et3rnal's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=445 View this thread: http://www.excelforum.com/showthread.php?threadid=26307 Hi AFAIK you can't change this size -- Regards Frank Kabel Frankfurt, Germany Et3rnal wrote: > Is there any way to increase the font size of the displayed data in > the forms Combo Box?? > > Et3rnal ...

how do you keep a column in date form
i'm making a spreedsheet in office excel, in column A I have a list of dates. I would type in 4/5 for an date and excel would automatic change the date to 4-Apr. I like this way, but when I got to cell 26, the change will not happen. I type in 4/5 and I get just the number 1 in the cell, for the rest of the cells down, can someone help me. Copy the cell that has the format you like and paste format it to the cells that you want to have the date format. "s2m2" <s2m2@discussions.microsoft.com> wrote in message news:F350F90F-24B9-4B79-BE39-20AB0414015D@microsoft.com......

Countdowns
I am trying to do a countdown to show the number of days, hours and minutes from now until a specific date. I can do this for the number of days but am struggling with the hours and seconds so if someone could help, it would be greatly appreciated. Thank you -- Angel160 ------------------------------------------------------------------------ Angel160's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=15503 View this thread: http://www.excelforum.com/showthread.php?threadid=489032 Hi =A1-NOW() formatted as "d hh:mm" where A1 contains the date(time)....

saving a spreadsheet with form controls
I smxlsx but an error message comes up requiring I save with a format compatible with the use of macros. The file has several vlookup and if statements, but isn't a huge file, yet when saved as an .xlsm it is 3+ mb's and errors out before it is saved. Any ideas how I can save this as a smaller file since I need to have several users on a shared network access the file without it locking up their systems. ...