Results 1 to 4 of 4
  1. #1
    TheDeceived is offline Novice
    Windows Vista Access 2007
    Join Date
    Sep 2010
    Posts
    8

    Semi-colon Functionality

    I have a database with a lot of text box fields for the user to enter data into. Through random keyboard mashing, I found out that if a user types something into a text box and it contains a semi-colon (";") anywhere in the string, then anything after that semi-colon disappears. Well I'm assuming it disappears and doesn't try and add it somewhere else.

    I know in VBA that if you use the .AddItem functionality of a listbox and then follow it with x amount of variables, each separated with a semi-colon, then it adds them to each column of that listbox.

    Is there anyway I can turn off the semi-colon functionality from a text box, or am I going to have to perform a check on every single text box in my form (which currently consists of at least 20 and rising)?



    I've already written the function as:

    Code:
    Public Function ReplaceSemiColon(searchString As String) As String
    
         If InStr(searchString, ";") > 0 Then searchString = Replace(searchString, ";", ":")
    
         ReplaceSemiColon = searchString
    End Function
    Which works fine but I really want to avoid having to put this clause into every single text box/combo box that is currently available to the user.

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    are the fields bound? if they're unbound, it should not matter, and it really shouldn't matter if the datatype in the box is supposed to be text.

  3. #3
    NoellaG's Avatar
    NoellaG is offline VIP
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Jun 2010
    Location
    Belgium
    Posts
    1,044
    Hi,

    is there any afterupdate or onkey code attached to the text boxes/form??? Normally a text box can contain as many ";" as you like. Semicolons are known to give some problems when exporting the data , but within Access they shouldn't give any trouble.

    gr
    NG

  4. #4
    TheDeceived is offline Novice
    Windows Vista Access 2007
    Join Date
    Sep 2010
    Posts
    8
    are the fields bound? if they're unbound, it should not matter, and it really shouldn't matter if the datatype in the box is supposed to be text.
    Nope, all fields are unbound.

    Hi,

    is there any afterupdate or onkey code attached to the text boxes/form??? Normally a text box can contain as many ";" as you like. Semicolons are known to give some problems when exporting the data , but within Access they shouldn't give any trouble.

    gr
    N
    The text boxes them self have only got the GotFocus, LostFocus and KeyDown events bound to them, but I'm not sure how this would effect it's ability to read semi-colons as a command rather than just a character.

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

Similar Threads

  1. Multiple options to create semi-unique letters
    By GenericHbomb in forum Import/Export Data
    Replies: 0
    Last Post: 07-27-2010, 08:46 AM
  2. Replies: 0
    Last Post: 06-29-2010, 07:32 AM
  3. Replies: 1
    Last Post: 06-16-2010, 11:54 PM
  4. Replies: 5
    Last Post: 01-22-2010, 08:21 AM
  5. Replies: 5
    Last Post: 09-16-2009, 01:56 AM

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