Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2009
    Posts
    13

    Question Unanswered: Invalid characters in Text Box

    I am still fairly new with Access and I am having problems with a free form text box that I set up in a database. Everytime someone types in a single quote ' for example the word "can't" I get a syntax error.

    is there a way to strip these invalid characters out or not allow them to be input?

    I have found some code in my search about

    Code:
    Me.FieldName = Replace(Me.FieldName, Chr(35), "")
    but I get an error on it everytime for the replace.

    Any assitance would be greatly appreciated.
    jayceesdj
    "I'm an idealist. I don't know where I'm going but, I'm on my way." ---carl sandburg

  2. #2
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    What exactly do you mean by a "free form text box?" I think you need to concentrate on finding out what the problem is, rather than looking for a work around. This is not normal Access behavior.

    Is this form bound? Is this texbox bound to a field in an underlying table? If so, what datatype is the field?
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  3. #3
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    Quote Originally Posted by Missinglinq View Post
    I think you need to concentrate on finding out what the problem is, rather than looking for a work around.
    So true. So very, very true. Great quote Missinglinq!
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

Posting Permissions

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