Results 1 to 3 of 3
  1. #1
    WickidWe is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2013
    Posts
    123

    Date pass parameter incorrect

    I have a form with two text fields with dates to select
    the first on is a "from Date" and the second is a "To Date"

    I have the following code used to pass a parameter
    to check if the from Date is > To Date then the msgbox will come up
    this is for when I change the dates
    in cmdEdit_onclick
    Code:
    If Me.txtFromDate > Me.txtToDate Then
     MsgBox "'Between Dated' must be more than Start Date!", vbExclamation
        Exit Sub
        Else
    I Use the Same Code in the cmdAdd and it works fine
    I have also had it working in the past. I am not sure why it changed.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,623
    What do you mean by 'incorrect'? What happens - error message, wrong results, nothing?

    I don't see anything wrong with the posted code.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Quote Originally Posted by WickidWe View Post

    ...I have a form with two text fields with dates... first on is a "from Date" and the second is a "To Date"...
    Are these, in fact, defined as Text Fields or Date/Time Fields?

    Linq ;0)>

Please reply to this thread with any new information or opinions.

Similar Threads

  1. How To Pass a String to a Parameter in a Report
    By hammer187 in forum Programming
    Replies: 1
    Last Post: 09-17-2012, 01:44 PM
  2. Replies: 2
    Last Post: 02-10-2011, 10:44 AM
  3. Pass image parameter to stored procedure
    By Kencao in forum Programming
    Replies: 3
    Last Post: 04-28-2010, 11:51 PM
  4. Pass list as parameter to in operator
    By bliever in forum Queries
    Replies: 5
    Last Post: 11-11-2009, 03:15 AM
  5. Pass a Parameter From a form to a Query
    By DDillesha in forum Forms
    Replies: 1
    Last Post: 10-28-2009, 12:49 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums