Skip to content

Instantly share code, notes, and snippets.

@onlyforbopi
Last active January 31, 2018 13:07
Show Gist options
  • Select an option

  • Save onlyforbopi/16b4df437792792a5f05ebc7527160fd to your computer and use it in GitHub Desktop.

Select an option

Save onlyforbopi/16b4df437792792a5f05ebc7527160fd to your computer and use it in GitHub Desktop.
1. MessageBox with Prompt 2. Clock with refresh
' This will create a clock that refreshes normally on the form
' For static time instead use "=Time()" with no refresh
' 1. Insert new unbound textbox
' 2. In Format/Format set "Long Time"
' 3. In Data/Control source set "=Time()"
' 4. In Form_Load event set "Me.TimerInterval = 1000" to set it to 1 second
' 5. In Other/Name name it txtClock (Optional)
' 6. In vba:
Private Sub Form_Timer()
Me.txtClock.Requery
End Sub
Private Sub QuitButton_Click()
' Status : Done
If MsgBox("Are you sure that you want to quit this database?", vbQuestion + vbYesNo + vbDefaultButton2) = vbYes Then
DoCmd.Quit
End If
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment