Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / May 2007

Tip: Looking for answers? Try searching our database.

Date Validation pop up

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
NoviceNana - 02 May 2007 19:48 GMT
Hi Everyone,

I was just asked to create a date validation pop up on a form that I'm
designing. The validation is a pop up box that asks the user if the
end date of the period is correct by taking the last date of the
previous period and adding the number of days in the current period.

So one field on the form asks for the end date of the last report
period and another field asks for the number of days in the current
period.  For example the last day of the previous review period could
be April 30, 2007 and the number of days in the current period is 7
days.  So they would like a pop up that says, "The last day of this
review period is May 6, 2007.  Is that correct?" And the you click
"yes" or "No"

Now I personally that there are better ways to do this that would make
more sense to me but I have to do what I'm told with this one... :-)

Any assistance? I'm slightly/moderately proficient at code.  My main
issue is how to make the message in the pop up box display the correct
date.

Any suggestions would be GREATLY GREATLY appreciated.
Nana
Dave Miller - 02 May 2007 22:15 GMT
Nana,

Try below:

Regards,

David Miller

Private Sub Button1_Click()
   Dim dtm as Date
   Dim Answer as Long

   dtm = me.txtDate

   Answer = msgbox("The last day of this review period is " & _
                               format(dtm + 7, "MMM D, YYYY") & _
                               ". Is that correct?", _
                                vbYesNo + vbQuestion, _
                               "Period Validation")
  Select Case Answer
           Case vbYes
                'Run Code
           Case vbNo
               Exit Sub
  End Select
End Sub
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.