Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    Join Date
    Jun 2021
    Posts
    6

    Access Subform Deleting Data Entries As I Type

    Hi! New to the forum and relatively new to Access. Hopefully the description of my problem makes sense.

    I have a main form that consists of different UZAs and their demographics. On this form, I have a subform where the record source is a table that will allow me to enter various transit systems that operate in that UZA.

    I have the main form and subform's child and master field linked via an UZA_ID that is in both the 1st combo box's row source and the subform's record source table.

    When I enter data into my subform, Access will allow me the enter around 1-5 characters before it highlights what I've typed and deletes it. Once it deletes the entry, it will allow me to keep typing and it saves the information. The form functions, but this highlighting and deleting issue is very annoying and a huge nuisance to the user. I've tried to attach a video to demonstrate the issue; however, I'm not sure if I did that correctly.

    Anyone have experience with this?



    Thanks!!

    AccessIssues.zip

  2. #2
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,566
    Hi
    Can you upload a zipped copy of the database so we can take a look?
    You can PM me if you need further help.
    Good Reading https://docs.microsoft.com/en-gb/off...on-description

  3. #3
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,474
    When I enter data into my subform, Access will allow me the enter around 1-5 characters before it highlights what I've typed and deletes it


    Now that is a new one!! Is there any events that are triggered on that field or form? Do they have some kind of code process to blank out a field in code before allowing data entry?

  4. #4
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Something this bizarre is really going to have us be able to work with the actual file, as mike60smart suggested!

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  5. #5
    Join Date
    Jun 2021
    Posts
    6
    Attached. Thanks for your help.

    - Open the DB and click on "Apportionments Table" on the right hand side under Parameters.
    - Click on "Add Apportionments / Edit Recipients".

    There is one event procedure on this form - simply to refresh the main form after this pop up closes. I did this because when you click "save", the main form in which data is being appended to would not update automatically w/ the new record. The highlighting and delating text issue predates this event procedure.

    PTD_Apportionments_20210602_FTAtables.zip

  6. #6
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,413
    Auto correct is making bad assumptions. Change to NO

    Click image for larger version. 

Name:	autoNO.png 
Views:	33 
Size:	34.8 KB 
ID:	45404

  7. #7
    Join Date
    Jun 2021
    Posts
    6
    Switching AutoCorrect worked for you? I switched it and I'm still having issues with it highlighting and deleting the text.

  8. #8
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,413
    Quote Originally Posted by SocialCompromise View Post
    Switching AutoCorrect worked for you? I switched it and I'm still having issues with it highlighting and deleting the text.
    I was a bit hasty with that. The real problem appears that the main form, frm_ApportionmentAddUZA is unbound. Access does not allow unbound forms to be linked. When you attempt to establish a relationship Access pops up a message stating that fact. Although you can actually type in linkage fields in the subform control's properties and Access will not complain. However performance is uncertain, as we see in this case.
    To fix it, I made tbl_Apportionments the form recordsource and bound all the textbox and combobox controls to the table fields. The problem went away.
    I did not check the validity of the bound frame control.

  9. #9
    ssanfu is offline Master of Nothing
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Note that "DATE" is a reserved word (and a built in command) in Access and shouldn't be used as an object name. (in at least 3 tables)


    Also should have "Option Explicit" as the 2nd line of each and every module.

  10. #10
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Can set VBA editor to automatically include Option Explicit with each new module.

    Tools > Options > Editor > check Require Variable Declaration

    Why this is not a default is mystery.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  11. #11
    Join Date
    Jun 2021
    Posts
    6
    Davegri,

    Thanks for the help. I think I did what you mentioned, and I'm still not having much luck on my end. I made a new DB and form to simplify things and potentially remove other variables.

    1. Bound the main form to Tbl_UZA
    2. All text boxes are bound to a control source

    When I type in the Transit System field on "Tbl_Recipients subform1", Access still highlights and deletes the text. If you type one word, it will highlight it before you get to the next record if you wait long enough. Its more pronounce on multi-word entries.

    Thanks again!!
    NewDBTest.zip
    Attached Files Attached Files

  12. #12
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,413
    Instead of an expression, make the textbox bound directly to the table field:

    Click image for larger version. 

Name:	sc.png 
Views:	16 
Size:	28.4 KB 
ID:	45418

  13. #13
    Join Date
    Jun 2021
    Posts
    6
    Then the Recipients subform doesn't update based on which UZA you choose. The only way I've been able to do that is by having the UZA_ID textbox as an expression. For instance, Charlotte's UZA will have different transit systems assigned to it from Concord, Greensboro, so on and so forth. I'd like for the subform table to update based on the UZA selection and I'd like to be able to add transit systems to this table and have the table assign it to the UZA selected.

    Sorry if I didn't make that point earlier... Is there a way to get this form to function in that manner?

  14. #14
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Should not save UZA_ID and UZA_Name and UZA_Code in Tbl_Apportionments, just UZA_ID.

    What is relationship - will each UZA have multiple apportionments? If not, then why two tables Tbl_UZA and Tbl_Apportionments?

    What is purpose of UZA_Code?

    Combobox on Copy Of Frm has BoundColumn set to Name field, not UZA_ID.
    Change properties to:
    ControlSource: UZA_ID - unless combobox is intended for input of search criteria, then should be UNBOUND and need code for search
    RowSource: SELECT UZA_ID, UZA_Name, UZA_Code FROM Tbl_UZA;
    BoundColumn: 1
    ColumnCount: 3
    ColumnWidths: 0";1.0",0.25"
    LimitToList: Yes

    Bind textbox to UZA_ID field or remove it as autonumber PK should be irrelevant to users. Or should return Name by binding to UZA_Name field.

    Advise not to use exact same field name in multiple tables.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  15. #15
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,566
    Hi

    See if the attached now does what you want
    Attached Files Attached Files
    You can PM me if you need further help.
    Good Reading https://docs.microsoft.com/en-gb/off...on-description

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 5
    Last Post: 05-15-2019, 10:36 AM
  2. Replies: 19
    Last Post: 08-10-2018, 03:22 AM
  3. Replies: 4
    Last Post: 02-03-2017, 12:12 PM
  4. Replies: 1
    Last Post: 02-11-2015, 07:45 AM
  5. Replies: 1
    Last Post: 08-03-2013, 10:41 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