Results 1 to 6 of 6
  1. #1
    Paintballlovr is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Jul 2013
    Posts
    96

    blocking blank spaces on a subform

    I'm trying to block copy and pasted blanks on a subform. Users are copying data from one program and entering it into a subform. Most of the time it works fine and they only capture the wanted characters, but sometimes they're getting blank spaces, which is causing matching issues. I would either like to prevent them from entering blank spaces in the first place or remove them (trim does not seem to clear them out of the table after the data has been recorded to the table). Any ideas?

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    have you looked into the Instr function? There are other functions that can help to parse text within a string such as, Mid, Left, InStrRev

  3. #3
    Paintballlovr is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Jul 2013
    Posts
    96
    Under closer inspection, I'm not sure if it is a copy/paste issue after all. I copied the data from my table and dumped it into excel and a funny thing happened, the fields that were reporting a long length dont have blank spaces but instead the data from the field is repeated on a second line. The data is displayed in access like "150086", with a reported length of 13 and in excel it's "150086
    150086"
    It only happens on some of the entries, so I'm not sure what is causing it/how to prevent it.

  4. #4
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    Different programs use different standards to recognize characters. My preferred method is to get copied data into a text file and then bring it into the DB. This usually strips away extraneous character spacing and carriage returns, etc. Not sure how things are happening for you, but you may try pasting into a text file and then, select all, copy, and then paste into the memo field. See if it makes a difference anyway. Just to wrap your head around what is going on....

  5. #5
    Paintballlovr is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Jul 2013
    Posts
    96
    I finally figured out what is going on [asked the users ]. The field in question is at the end of the row, which is one line high. They sometimes hit the enter key trying to get to the next line, but that just does a carriage return within the cell. Now they don't see the number they just typed, so they type it a second time, resulting in the same entry in twice (and sometimes more). A patchwork fix of expanding the field to two lines high will show them that the number is there and they can continue on until I can look into disabling the enter key (they're supposed to be using tab, but I know habits can be hard to break). Thank you everyone for helping out so quickly!

  6. #6
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    You could use a control button the user has to click. The click event could paste into a textbox that is enabled but also locked. You could maybe use acPaste.

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

Similar Threads

  1. Removing blank spaces created by LEFT statement
    By Paintballlovr in forum Queries
    Replies: 16
    Last Post: 07-09-2013, 12:19 PM
  2. Subform is blank in Form view
    By wardw in forum Forms
    Replies: 2
    Last Post: 05-28-2013, 12:57 PM
  3. Procedure for Blocking Multiple Users?
    By JonMulder in forum Programming
    Replies: 3
    Last Post: 04-04-2013, 05:02 PM
  4. Remove blank spaces after strings in fields
    By Modify_inc in forum Access
    Replies: 8
    Last Post: 08-18-2012, 06:30 PM
  5. Blank spaces at start of entries
    By rcmglover in forum Access
    Replies: 2
    Last Post: 03-26-2010, 10:42 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