What is wrong with this simple code

EPD Hater

Registered User.
Local time
Today, 04:21
Joined
Mar 30, 2003
Messages
50
I've searched these forums for the Default Value = previous value thing. I've done this before, but I can't seem to remember how...this is what I have on my Exit event:

Code:
Private Sub Text58_Exit(Cancel As Integer)
    
    Text58.DefaultValue = Text58.Value

End Sub

This works ONLY if my value is numeric; if it is not numeric, i get the #NAME? error in the next records text box. Why is this only working for numeric values? The data type in the associated table for this field is text.
 
That also works, but still only for numerics, nothing with text will work
 
I think the problem is that DefaultValues follow SQL delimiter conventions.

TextField

Text58.value = "'" & Text58.OldValue & "'"

Date Field

Text58.value = "#" & Text58.OldValue & "#"

I have gotten the #Name error if I do not use the right delimiters.

Try this.
 
OOPS!

TextField

Text58.DefaultValue = "'" & Text58.OldValue & "'"

Date Field

Text58.DefaultValue = "#" & Text58.OldValue & "#"
 

Users who are viewing this thread

Back
Top Bottom