Results 1 to 7 of 7
  1. #1
    burrina's Avatar
    burrina is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383

    If Date IsNull

    I have a field that uses the default value another date field.Problem is, what if that field is null, i get a error message on my field.
    =[txtentered]



    What can I do so this does not show an error?

    Field control source is nextschddte

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,619
    Not sure what you mean by 'uses the default value another date field'. Why are you setting one control equal to another control?
    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
    burrina's Avatar
    burrina is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383
    NO, it has it's own control source but the default value is as above, poor wording on my part. Under Data Tab I set it to use that value.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,619
    Tried to replicate the issue but no luck.

    However, doesn't make sense to me. DefaultValue only applies when new record is initiated. The DefaultValue will read value in [txtentered] at time the record is initiated and use that. Why would [txtentered] have a value for a new record?
    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.

  5. #5
    burrina's Avatar
    burrina is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383
    That value is needed because other code and text displays depend on it. It would have a value so NO error messages would be showing on the form as an example. I don't like
    #Name? showing up on the field and yes this happens ONLY when it is a new record.

  6. #6
    burrina's Avatar
    burrina is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383
    SOLUTION: 'Purpose: Trap #Name? message on field on new record.
    If Me.NewRecord = True Then
    Me.nextschddte.DefaultValue = ""
    End If


    Thanks,

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,619
    That error means Access isn't finding any control or field by that name on the form.

    I tested a DefaultValue set to another field and do not get error. Don't know why you were.

    Glad you found a fix.
    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.

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

Similar Threads

  1. Replies: 2
    Last Post: 11-26-2012, 11:12 PM
  2. If IsNull Value, Then need to be Zero
    By burrina in forum Forms
    Replies: 2
    Last Post: 11-18-2012, 02:53 AM
  3. IsNull
    By JJCHCK in forum Programming
    Replies: 3
    Last Post: 09-09-2011, 07:57 AM
  4. dcount and isnull
    By Madmax in forum Access
    Replies: 7
    Last Post: 06-22-2011, 09:31 AM
  5. IsNull question
    By Simon Sweet in forum Access
    Replies: 4
    Last Post: 12-22-2007, 04:33 PM

Tags for this Thread

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