Page 1 of 2 12 LastLast
Results 1 to 15 of 20
  1. #1
    Silver Lounger
    Join Date
    Dec 2000
    Location
    Northampton, Northamptonshire, England
    Posts
    1,951
    Thanks
    2
    Thanked 1 Time in 1 Post

    MsgBox (Access 2003)

    Hi All

    I have a field formated to date I would like to be able to enter a date and when this date matches datenow I would like to see a Msgbox pop up.
    is this possible please.

    Braddy
    If you are a fool at forty, you will always be a fool

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: MsgBox (Access 2003)

    Is datenow another field, or do you mean the current date by datenow? And what do you want to accomplish with the message box?

  3. #3
    Silver Lounger
    Join Date
    Dec 2000
    Location
    Northampton, Northamptonshire, England
    Posts
    1,951
    Thanks
    2
    Thanked 1 Time in 1 Post

    Re: MsgBox (Access 2003)

    Hi Hans

    I mean the current date, It's client database it is so I can use it as a call back reminder.

    Thanks

    Braddy
    If you are a fool at forty, you will always be a fool

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: MsgBox (Access 2003)

    You should do this on a form based on the table. You can write code in the After Update event of the text box bound to the date field:

    Private Sub txtDateField_AfterUpdate()
    If Me.txtDateField = Date Then
    MsgBox "You entered the current date!", vbInformation
    End If
    End Sub

    Or do you mean that you want to enter a date in the future, say 20 December, and you want a message box to pop up if you open the database on 20 December? If so, what if you don't open the database on 20 December, but you do on 22 December?

  5. #5
    Silver Lounger
    Join Date
    Dec 2000
    Location
    Northampton, Northamptonshire, England
    Posts
    1,951
    Thanks
    2
    Thanked 1 Time in 1 Post

    Re: MsgBox (Access 2003)

    Hi

    I am doing something wrong can you tell me what please.

    Braddy
    If you are a fool at forty, you will always be a fool

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: MsgBox (Access 2003)

    If you look at the code, you will see that you have nested an Ater Update procedure inside another After Update procedure: there are two lines with Private Sub below each other, and two lines with End Sub below each other. You should have only one of each. Keep the Private Sub line with the correct name of the control.

  7. #7
    Silver Lounger
    Join Date
    Dec 2000
    Location
    Northampton, Northamptonshire, England
    Posts
    1,951
    Thanks
    2
    Thanked 1 Time in 1 Post

    Re: MsgBox (Access 2003)

    Hi Hans

    I have corrected my silly mistake and now I get no error, but i also do not get the msgbox if i enter the date equal to todays date.

    Braddy
    If you are a fool at forty, you will always be a fool

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: MsgBox (Access 2003)

    In the code in your screenshot, the name of the control in the Private Sub line and in the If ... Then line don't match. You must use the real actual correct name of the text box in both instances.

  9. #9
    Silver Lounger
    Join Date
    Dec 2000
    Location
    Northampton, Northamptonshire, England
    Posts
    1,951
    Thanks
    2
    Thanked 1 Time in 1 Post

    Re: MsgBox (Access 2003)

    Hi Hans

    Sorry to be a pain could you show me how it should look, the name of the field is callback.

    Thanks

    Braddy
    If you are a fool at forty, you will always be a fool

  10. #10
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: MsgBox (Access 2003)

    Private Sub Callback_AfterUpdate()
    If Me.Callback = Date Then
    MsgBox "You entered the current date!", vbInformation
    End If
    End Sub

  11. #11
    Silver Lounger
    Join Date
    Dec 2000
    Location
    Northampton, Northamptonshire, England
    Posts
    1,951
    Thanks
    2
    Thanked 1 Time in 1 Post

    Re: MsgBox (Access 2003)

    Hi Hans

    Thank you for your continued patience, So far it only happens when I actullaly enter the date, I would like to see the message each time I go to the record.

    If you understand each time I go to a record for a client it will tell me I need to call him back. I hope this is clear.

    Thanks

    Braddy
    If you are a fool at forty, you will always be a fool

  12. #12
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: MsgBox (Access 2003)

    Do you really want to see that message again and again if you move back and forth between the records? The Current event, which is the only place I can think of off-hand to use for that, fires many times, including when you move to a record, when to change a record and save the changes, and multiple times when the form is opening.
    Charlotte

  13. #13
    Silver Lounger
    Join Date
    Dec 2000
    Location
    Northampton, Northamptonshire, England
    Posts
    1,951
    Thanks
    2
    Thanked 1 Time in 1 Post

    Re: MsgBox (Access 2003)

    Hi Charlotte

    Your quite right I don't want to see the message over and over again, I only want to see it when the call back field matches the date which should only be one day.
    On making the the callto the cllient, the called field entry will be deleted or reset. What I am trying to achieve some similar to act or outlook where you can set a reminder to do something like call a client.

    Thank you for your response I hope this is clear.

    Braddy
    If you are a fool at forty, you will always be a fool

  14. #14
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: MsgBox (Access 2003)

    Can I suggest that you test for :
    <pre> Me.txtDateField >= Date </pre>

    rather than
    <pre> Me.txtDateField = Date </pre>



    in case you happen not to use the database on the day a contact is due.
    Regards
    John



  15. #15
    Silver Lounger
    Join Date
    Dec 2000
    Location
    Northampton, Northamptonshire, England
    Posts
    1,951
    Thanks
    2
    Thanked 1 Time in 1 Post

    Re: MsgBox (Access 2003)

    Hi John

    Thanks for the reply I look at it later

    Thanks

    Braddy
    If you are a fool at forty, you will always be a fool

Page 1 of 2 12 LastLast

Posting Permissions

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