Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Disable MS ACCESS's adding apostrophe in text field

Posted on 2005-04-05
7
Medium Priority
?
810 Views
Last Modified: 2008-01-09
I have a data entry form to create values for a list.  I have prevented the user from entered  'apostrophe's', but when the user types

dont

without the apostrophe, MS ACCESS automatically fills in the apostrophe and now my AFTER_CHANGE event doesn't catch the apostrophe and lets it get saved.  

Anyone help me disable MS ACCESS's checking and inserting of apostrophes or other nice fix?

Am installing tomorrow morning, so any help tonight is much appreciated!

0
Comment
Question by:lbillau
  • 2
  • 2
  • 2
  • +1
7 Comments
 
LVL 11

Expert Comment

by:Jokra_the_Barbarian
ID: 13714112
For the dont spelling, look at Tools/Options..Spelling Tab..AutoCorrect. You will see dont is corrected to don't. Disable the autocorrect feature.

I use the replace() function for just this purpose when inserting data from Access into a SQL table. For insertion/update, use replace(str,"'","''"). When reading back to the listbox, use replace(str,"''","'").
0
 
LVL 12

Accepted Solution

by:
Trygve earned 2000 total points
ID: 13714117
The AllowAutocorrect property for the control (14th from the top in my Access2003 testbase) set to false should take care of this problem.

I also tested using code in the AfterUpdate event and it did work in my test app so there might be some additional problem, please let me know...

' This worked
Private Sub cText0_AfterUpdate()

    Me.cText0 = Replace(Me.cText0, "'", "") ' Apostrophe between two "s as second parameter
   
End Sub
0
 

Author Comment

by:lbillau
ID: 13714492
Thank you for the comments.  Have tried the AllowAutoCorrect property set to False and yes it does keep dont as dont, but when I use the list value in a combo box on a later form, the apostrophe in the don't shows back up!  I've tried setting the combo box's AllowAutoCorrect property to False too, but doesn't help.  It is now middle of the njight and am leaving this until first thing in morning....the last error!
0
Fill in the form and get your FREE NFR key NOW!

Veeam is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

 
LVL 12

Expert Comment

by:Trygve
ID: 13714530
Could you please post the code that keeps the values so that we may reproduce the form in our test apps ?
0
 
LVL 85
ID: 13715378
Why are you disallowing apostrophes? As Jokra and others have suggested, it's pretty simple to work around them, especially if you're using 2000 or greater (the Replace function used in this thread is not available in 97).
0
 
LVL 11

Expert Comment

by:Jokra_the_Barbarian
ID: 13715808
If you've got autocorrect disabled, I think the only way that it's getting in the listbox is if you're reading it from the table or recordset, or it is being populated manually in code somewhere. It's something to check.
0
 

Author Comment

by:lbillau
ID: 13716688
Thanks!  The Autoconnect was working as advertised in the solutions above but I had forgotten about a second form that was Bound to the table so it
also needed autocorrect=No to keep it from correcting that same record.   Once I found that form all is good and the single quotes are gone.
Thank you so much!
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Suggested Courses

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question