Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

#Type! using replace on Long text field

#Type! using replace on Long text field

#Type! using replace on Long text field

I have a control that is returning a #Type! error on a report... The control source is below. Field1 in this case is long text.
What am I missing as FindField is also text... probably short text?


= Replace([Field1], "[FindField]", NZ([FindField], "")) 

Similar expression works in a query. I am at a loss...

RE: #Type! using replace on Long text field

Are you sure you want [FindField] in quotes? Are you actually looking for the exact characters "[FindField]"?
This is the documentation:
Replace ( string1, find, replacement, [start, [count, [compare]]] ) from this TechOnTheNet.

Hook'D on Access
MS Access MVP 2001-2016

RE: #Type! using replace on Long text field

Yes that is actually what I am doing. If i could find a clever way to do that replacement from the source data by detecting the fields in square brackets that would be extremely useful. Alas I don't think there is a way to pass the report object to a user defined function to pull it off (Parent may work?)... but that doesn't solve my error issue.

RE: #Type! using replace on Long text field

It would probably help illustrate your issue if you provided a couple sample records with at least the significant fields.

Hook'D on Access
MS Access MVP 2001-2016

RE: #Type! using replace on Long text field

I feel stupid...

It was a circular reference... the name of the control was Field1...

My general practice is to always rename the control whenever I do anything to change the the control source from wizard generation... So not sure how this happened this time or why I am not getting a more reasonable error. Side note, I did see this same error earlier to day when someone failed to wrap the replacement value in a NZ function.

Two possible causes of #Type! error I have seen other than more obvious type issue...

Control name is used in the control source (failure to rename control to not be a field in the record source).
The replacement value has a null value (optionally use NZ to handle the null)

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close