Results 1 to 3 of 3
  1. #1
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Apostrophy (2000)

    How can I prevent a text box from accepting apostrophies? Any number of upper or lower case letters or spaces are OK, but apostrophies are creating some query issues. I've tried a validation rule in the table, but I'm not doing it right (i.e. Not "'", <>')
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

  2. #2
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Apostrophy (2000)

    You need to add the following few lines of code to your textbox's BeforeUpdate event. I just made-up a control name.

    If instr(txtWhatever,chr(39)) > 0 then
    Msgbox "You can't use an apostrophe!",vbcritical
    Cancel=true
    exit sub
    endif
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  3. #3
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Re: Apostrophy (2000)

    Perfect! I was trying to address this from the table, but (thinking about it) it only applies to two forms (frmAdd and frmEdit). Thanks Mark.
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

Posting Permissions

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