Function problem

  • Thread starter Thread starter niclive
  • Start date Start date
N

niclive

Please help.I am new to VBA.
I want to create a public function and embed it in my startup splash
form that quits the application if date() > mydate unless a user puts
in a value(input box in the function will take this value and assign
it to a variable).
Please help.
 
hi,

Please help.I am new to VBA.
I want to create a public function and embed it in my startup splash
form that quits the application if date() > mydate unless a user puts
in a value(input box in the function will take this value and assign
it to a variable).

Public Sub Quit(ADate As Date)

On Local Error GoTo LocalError

If ADate < Date() Then
If Len(Trim(Nz(txtInput.Value, ""))) = 0 Then
DoCmd.Quit acSavePrompt
End If
End If

Exit Sub

LocalError:
MsgBox Err.Description & "; Err#:" & Err.Number

End Sub



mfG
--> stefan <--
 
Back
Top