Results 1 to 2 of 2
  1. #1
    blacksaibot is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Jan 2010
    Posts
    34

    Special characters in Default Value and Query

    First of all, this is not my database design choice, it's just what I have to deal with....



    The DB guy designed a table which has a field with a default value of 'No' (single quotes include). It's a textfield.

    I am creating a form to input data into that table. I want the textbox that is associated with the above mentioned field to have its default value as 'No' (single quotes included). If I just type 'No' in the properties box for the text box, it removes the single quote when I view my Form in Form View.

    ALSO, I then need to make my code below create a SQL query that will not have an error in it when inserting a string with a single quote in it.

    Thanks

  2. #2
    blacksaibot is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Jan 2010
    Posts
    34
    this is the error I get when running my insert code after clicking the submit button

    Run-time error '3705':
    Syntax error (missing operator) in query expression "'No'".

    This is the code that's used to grab the value in my query:

    Code:
    queryStr = "INSERT INTO [t_User_Ldr_Info] VALUES(" & _
    "'" & dag_rfi & "', " & _
    
    '....and some more code down here to finish the query
    should there be another way I grab the text from my textbox named dag_rfi (whose value is 'No')??

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Need to delete special characters
    By tlrutledge in forum Queries
    Replies: 1
    Last Post: 08-23-2013, 03:10 AM
  2. Replies: 2
    Last Post: 08-17-2011, 03:02 AM
  3. Query to perform several special operations
    By Allison in forum Queries
    Replies: 4
    Last Post: 05-13-2011, 04:30 PM
  4. Union query only returning 255 characters
    By jpkeller55 in forum Queries
    Replies: 25
    Last Post: 10-05-2010, 05:51 AM
  5. Special Characters
    By orgelizer in forum Access
    Replies: 0
    Last Post: 03-20-2007, 08:24 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums