- Start Microsoft Access and create a blank database
- Save the database as Progress Clock
- Start a new form in Design View. Save it as ProgressClock
- To use the needed progress bars, on the Toolbox, click the More
Controls button
- From the list, click Microsoft Progress Bar Control, Version 6.0 and
click somewhere on the form
- Right-click the progress bar in the form and click Copy. Then
right-click the form twice and click Paste twice
- Design the form as follows:
|
Control |
Properties |
Form |
Caption: Progressive Clock
Navigation Buttons: No
Modal: Yes
Border Style: Dialog
Timer Interval: 20 |
Label |
Caption: Time |
|
|
Label |
Caption: Hours: |
Progress Bar |
Name: prgHours
Max: 23 |
TextBox |
Name: txtHours
Text Align: Center |
Label |
Caption: Minutes: |
Progress Bar |
Name: pgrMinutes
Max: 59 |
TextBox |
Name: txtMinutes
Text Align: Center |
Label |
Caption: Seconds: |
Progress Bar |
Name: pgrSeconds
Max: 59 |
TextBox |
Name: txtSeconds
Text Align: Center |
|
- Double-click the selection button of the form .
In the Properties window, click the Events tab. Access the On Timer event
of the form and implement it as follows:
Private Sub Timer1_Timer()
Dim CurTime As Date
Dim ValHours As Integer
Dim ValMinutes As Integer
Dim ValSeconds As Integer
CurTime = Time
ValHours = Hour(CurTime)
ValMinutes = Minute(CurTime)
ValSeconds = Second(CurTime)
pgrHours.Value = ValHours
pgrMinutes.Value = ValMinutes
pgrSeconds.Value = ValSeconds
lblHours.Caption = CStr(ValHours)
lblMinutes.Caption = ValMinutes
lblSeconds.Caption = CStr(ValSeconds)
End Sub
|
- Test the application
|