Results 1 to 4 of 4

Thread: Pop-up message

  1. #1
    Join Date
    Sep 2002
    Posts
    79

    Unanswered: Pop-up message

    Is there a way to create a field in my database that is a date field and when I manually enter a date (future date), access will pop up a message I entered in a different field (text field)?

    Also, if the date I entered has already expired, I would like for access to still give me that message just once…

  2. #2
    Join Date
    Nov 2003
    Posts
    1,487

    Re: Pop-up message

    Originally posted by alex8111
    Is there a way to create a field in my database that is a date field and when I manually enter a date (future date), access will pop up a message I entered in a different field (text field)?

    Also, if the date I entered has already expired, I would like for access to still give me that message just once…

    Do you mean when focus has gone from the date field to a text field or that simple text is writen in the date field?

  3. #3
    Join Date
    Mar 2003
    Location
    Bogota
    Posts
    67

    Re: Pop-up message

    Originally posted by alex8111
    Is there a way to create a field in my database that is a date field and when I manually enter a date (future date), access will pop up a message I entered in a different field (text field)?

    Also, if the date I entered has already expired, I would like for access to still give me that message just once…
    Assuming you are using a form, and have a table called 'messages', with a date field called 'msg_date' and a text field called 'msg_text':

    Use something like this on your After Update event of the date text box on your form:

    Dim sMsg as string
    Dim sCriteria as string
    Dim dDate as Date

    dDate = txtDate 'PUT THE DATE YOU ENTERED IN A VARIABLE
    sCriteria = "msg_date = #" & dDate & "#" 'AND THE LOOKUP CRITERIA
    if dDate > date() then 'IF THE DATE IS FUTURE
    'USE DLOOKUP TO RETRIEVE THE TEXT FROM THE TABLE
    sMsg = DLookup("msg_txt","messages", sCriteria)
    else
    'I DIDNT REALLY UNDERSTAND THE 2ND PART OF YOUR QUESTION
    'BUT THE CODE WOULD GO HERE
    end if

    Hope this helps

  4. #4
    Join Date
    Sep 2002
    Posts
    79
    How can itest this? I did what you said but nothing has happened

Posting Permissions

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