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
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
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.
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.
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.
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.
SOLUTION: 'Purpose: Trap #Name? message on field on new record.
If Me.NewRecord = True Then
Me.nextschddte.DefaultValue = ""
End If
Thanks,
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.