Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2005
    Posts
    102

    Unanswered: Limiting Access to a form if time is?

    Okay, I have a form that allows users to add items to an existing order. But there's a cutoff time to add these items, which is 2:00 pm.

    On the On Open procedure of the form, I want to insert something that looks like this but I do not know how to write it so VB can understand.

    If Time() Is in between 2 pm and 6 pm then
    MsgBox "You are not allowed to add anymore items"
    DoCmd.Close
    Else
    DoCmd.Maximize

    The statement in red is the only part i need. Please help.

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    If Format(now, "short time") >= "14:00" AND Format(now, "short time") < "18:00" Then
    MsgBox "You are not allowed to add anymore items"
    DoCmd.Close
    Else
    DoCmd.Maximize
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  3. #3
    Join Date
    Jun 2005
    Posts
    102
    Thank you Teddy, your post are always helpful.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •