Results 1 to 10 of 10
  1. #1
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts
    Just installed A2010, and have an immediate problem.

    This only happens with an unbound control that has a Default Value specified. Whether or not the form is bound doesn't seem to make a difference.

    The problem is that I can't enter a Null value into this unbound control! I remove the current value, but as soon as I move off the control Access restores it with the Default Value. Even if I put another value in first and then try to remove that, it returns to the Default Value.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  2. #2
    5 Star Lounger AndrewKKWalker's Avatar
    Join Date
    Apr 2001
    Location
    Cambridge, UK
    Posts
    1,020
    Thanks
    0
    Thanked 3 Times in 3 Posts
    Interesting!
    Seems to be a New Feature (But annoying!)
    Andrew

  3. #3
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts
    I just fired up my copy of 2010, and can confirm the same thing happens for me.
    Regards
    John



  4. #4
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    Brisbane, Queensland, Australia
    Posts
    387
    Thanks
    0
    Thanked 1 Time in 1 Post
    What a fabulous new feature! Now all I have to do is figure out a work around...

    The value has returned before the before update event occurs but, strangely, the text property is still an empty string.

    So if you need to dynamically create an SQL string then you might try doing it here.

    I can't find a way to defeat it. if i try to set the value back to null, in code, I fail.

    Depending on what you are using it for, a (combo box filter perhaps?) with something like -

    ALike [Forms]![frmSeminarBooking]![cboDay] & "%"

    in the following combo's rowsource

    you can use a command button titled "All" to set the value of the recalcitrant control to "%" which will give you the required outcome but you can't set it to null using the button.

    and yes you can manually enter % but try telling a user that.

  5. #5
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    Brisbane, Queensland, Australia
    Posts
    387
    Thanks
    0
    Thanked 1 Time in 1 Post
    Another note on filtering with combos - If you have a two column thing going on with the first column hidden then you can use a union query to append an "all" to the top -

    SELECT "%", "All" FROM tblSelections
    UNION
    SELECT Selection_ID, Selection_Text FROM tblSelections

    so when the user selects "All" the % is passed to the ALike filter.

    I've given up trying to use Like with the asterisk. Access keeps changing my 'Like' to 'ALike' but fails to change the * to %

    Easier not to fight some things...

  6. #6
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts
    Quote Originally Posted by kentg View Post
    What a fabulous new feature! Now all I have to do is figure out a work around...
    If you remove the default value in the OnChange event, the Null value stays put.
    Regards
    John



  7. #7
    5 Star Lounger AndrewKKWalker's Avatar
    Join Date
    Apr 2001
    Location
    Cambridge, UK
    Posts
    1,020
    Thanks
    0
    Thanked 3 Times in 3 Posts
    I wonder if this is a NEW Feature, or a feature that will be removed in a later Patch.
    I suspect a New feature.
    Andrew

  8. #8
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts
    Quote Originally Posted by Andrew W View Post
    I wonder if this is a NEW Feature, or a feature that will be removed in a later Patch.
    I suspect a New feature.
    I can't believe this is a new Feature, unless there was a new control option, something like "How to Handle Null Values".
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  9. #9
    5 Star Lounger AndrewKKWalker's Avatar
    Join Date
    Apr 2001
    Location
    Cambridge, UK
    Posts
    1,020
    Thanks
    0
    Thanked 3 Times in 3 Posts
    I can't believe this is a new Feature
    One would hope not, but I'm not holding my breathe until they fix it. If they do
    Andrew

  10. #10
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    Brisbane, Queensland, Australia
    Posts
    387
    Thanks
    0
    Thanked 1 Time in 1 Post
    I think the theory is that a Null value means that a value has not yet been selected, so if a default has selected a value for you then you should not revert to Null.

    Even so I would then think a zero length string should be allowed.

    As Access developers we have been using (and in purely theoretical terms, abusing) Nulls for years and Access is very cooperative in what it lets us do. In other languages Nulls are not so forgiving.

    John's answer to change the default in the onchange should work in most situations where you only want the default when the form is first opened.

    You really would think that with a change this significant it should have been announced in the State of the Union. But seriously, does MS publish full release notes for Access somewhere apart from the PR blurbs?

Posting Permissions

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