Results 1 to 5 of 5
  1. #1
    warmslime is offline Advanced Beginner
    Windows 10 Access 2013
    Join Date
    Jan 2016
    Posts
    49

    Small question regarding datasheet forms - selected text

    When I open a datasheet form, the first field of the first record is already selected (as in, its text is selected)
    Click image for larger version. 

Name:	Καταγραφή.JPG 
Views:	13 
Size:	25.8 KB 
ID:	27718


    is there any way to prevent this behavior, either by changing a property or programmatically? I don't mind the cursor's position (because the user can't edit the form anyway) but I wish the text wasn't highlighted as it looks a bit ugly...

  2. #2
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,741
    Create a textbox on the form and call it txtDummy. Set its width and height to .001, set left to 0, top to 0, and background transparent. Then code the form_Current event:
    Code:
    Private Sub Form_Current()
        txtDummy.SetFocus
    End Sub

  3. #3
    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
    This kind of depends on how this is used. If you go to

    Options - Advanced – Behavior Entering Field

    I suspect that you'll see that 'Select Entire Field' is selected. If this is a one-off database, i.e. it'll only be run on this one machine, you can chose a different option, i.e. 'Go to End' or 'Go to Beginning' of Field. The same thing goes if you want other Fields to be selected on entering (although I think this is dangerous, leading to accidental deletions) but not this one.

    If it's going to be used on different machines, you can use code like
    Code:
    Private Sub TextboxName_GotFocus()
     TextboxNameName.SelStart = 0
    End Sub


    replacing TextboxName with your actual name.

    Linq ;0)>

  4. #4
    warmslime is offline Advanced Beginner
    Windows 10 Access 2013
    Join Date
    Jan 2016
    Posts
    49
    Thank you all for the responses. Missingling's response was the one I applied (cause it was the fastest) and it works great.

  5. #5
    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
    Glad we could help!

    Linq ;0)>

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

Similar Threads

  1. Replies: 6
    Last Post: 05-26-2015, 10:31 AM
  2. Variabe small question
    By Madmax2 in forum Access
    Replies: 3
    Last Post: 07-21-2014, 10:14 AM
  3. Relationship (small Question)
    By lebronjames in forum Access
    Replies: 3
    Last Post: 11-07-2012, 08:41 PM
  4. Replies: 4
    Last Post: 05-04-2012, 03:41 PM
  5. Small Business Question
    By P5C768 in forum Access
    Replies: 1
    Last Post: 09-28-2009, 08:27 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