Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Access 2003 VBA Programmer's Reference
This is the forum to discuss the Wrox book Access 2003 VBA Programmer's Reference by Patricia Cardoza, Teresa Hennig, Graham Seach, Armen Stein; ISBN: 9780764559037
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Access 2003 VBA Programmer's Reference section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 21st, 2004, 10:49 AM
Authorized User
 
Join Date: Jun 2004
Location: Cumberland, MD, USA.
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
Default Faulty Date Logic

Is the IF statement in the code at the top of p.292 correct?

The IF statement ...

If txtEndDate > txtStartDate Then
   'Alert the user and Cancel the update
   Cancel = MsgBox(Start Date must be before the End Date", _
     vbInformation, "Data Validation Failure")
End If

is used to validate that the Start Date is before the End Date (or conversely, that the End Date is after the Start Date). The dates would be invalid if the Start Date were GREATER THAN the End Date.

In order for the code to work correctly, shouldn't the IF statement be changed to ...

If txtStartDate > txtEndDate Then
   'Alert the user and Cancel the update
   Cancel = MsgBox(Start Date must be before the End Date", _
     vbInformation, "Data Validation Failure")
End If



Terry Waltz
__________________
Terry Waltz
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
help to solve the logic pradeepn XSLT 4 May 22nd, 2007 06:07 AM
And/Or Logic??? ninel SQL Server 2000 2 February 9th, 2007 11:33 AM
Buggy and Faulty code in Vb sun21170 BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 2 September 18th, 2006 08:59 PM
Mixing Data access logic and business logic polrtex BOOK: Professional Jakarta Struts 0 December 15th, 2003 07:19 PM



All times are GMT -4. The time now is 07:33 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.