Results 1 to 5 of 5
  1. #1
    ebrommhead is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2012
    Location
    Mississauga
    Posts
    28

    Field Edit to Avoid No Entry is Not Working

    I have attached a copy of part of my program where a user inputs a date to get the next 10 days of expected customer deliveries. I input a criterion that the date input must be in the future, ie > today. When I input an earlier date and hit the arrow on the Customer drop down box, I get the message that the date is incorrect and cursor goes to the date input field. So that part works.



    However, if I leave the date input (text16) blank and hit the arrow on the Customer drop down box, I get the message "The expression is typed incorrectly," yada, yada,yada. It is the same message as when I try to run the query that sets up the combo box for the Customer. (Note: when the text16 field is left blank it is equal to " ".)

    Not really sure what I am doing wrong. Any assistance would be most appreciated.
    Attached Files Attached Files

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    I presume text16 is the name of your date entry field - if it is blank, it will be null, not a zls (zero length string). Dates are numeric, not text so cannot =""

    Also your code is <Date, so an entry of today is acceptable - which does not fit with your 'must be in the future, ie > today'

  3. #3
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    You should take the time to rename the controls to something meaningful; instead of "Text16", maybe rename the text box to "ubStartDate". ("ub" is for unbound)
    So looking at the code, which is easier to understand, Me.Text16 or Me.ubStartDate?

    Same with the combo box: Me.Combo10 or Me.ubCboCustomer? ("ub" = unbound, "cbo" = combo box)

  4. #4
    ebrommhead is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2012
    Location
    Mississauga
    Posts
    28
    Thanks. I normally do but I was trying to do this quickly, which obviously didn't work.

    Ed

  5. #5
    ebrommhead is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2012
    Location
    Mississauga
    Posts
    28
    Thanks for your response.

    I was using Is Null but did an Immediate window, you can see it about the middle of the attachment, and the Is Null came back False where the "" came back as True, so I assumed that text16 equaled "".

    Yes, you are correct about the <Date. I added +1 to rectify the problem.

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

Similar Threads

  1. data entry/edit form
    By Jen0dorf in forum Access
    Replies: 5
    Last Post: 06-06-2016, 08:56 AM
  2. Replies: 5
    Last Post: 02-27-2016, 08:02 AM
  3. Avoid multiple entry for foreign key
    By Alico in forum Access
    Replies: 2
    Last Post: 09-08-2014, 09:52 PM
  4. How to get entry of a specific Edit-Box ?
    By fluppe in forum Access
    Replies: 3
    Last Post: 07-15-2014, 09:18 AM
  5. How to edit entry in table from VBA ?
    By fluppe in forum Programming
    Replies: 5
    Last Post: 07-14-2014, 08:32 AM

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