Results 1 to 14 of 14
  1. #1
    NJ-Tom is offline Novice
    Windows 10 Access 2016
    Join Date
    Sep 2016
    Location
    Westfield, NJ
    Posts
    9

    VBA Editor acting strangly

    I'm using Access 2016 but had the same problem in the prior version. Sometimes, not all the time, the editor gets weird. The tab key and space key don't work hit a space bar and the space is inserted but then the insertion point moves back to the last character typed, and while typing access resolves the capitalization of the command; e.g., while typing docmd. the vba editor changes it to DoCmd. Has anyone seen anything like this and figured it out? Very annoying.

    Thanks Tom

  2. #2
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    this question is being asked a lot at the moment. It is usually due to a timer event running in the background

  3. #3
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Thanks, Ajax! This is the most frustrating thing, I even had it all the way back in v 97. Always thought it was me, lol.

  4. #4
    NJ-Tom is offline Novice
    Windows 10 Access 2016
    Join Date
    Sep 2016
    Location
    Westfield, NJ
    Posts
    9
    Thank you Ajax. I'm using a timer event to post the date and time on the forms, is that what you are referring to?
    It is a weird problem, I have two computers - if the problem is happening on one it is also on the other and if not, then both are ok.
    Do you know of a fix other than to not use the timer?

  5. #5
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    I can only speak for the auto capitalization behaviour - as far as I know, the VBA editor has always done that. For me, it is far from annoying, it is very convenient for catching mistakes as soon as you make them. If Access recognizes a word as a variable name, function name, command, control name etc, it will automatically match the capitalization.

    I find that if I always include at least one Capital letter in object and variable names, a lot of typos are caught when what I type doesn't get matched.

  6. #6
    NJ-Tom is offline Novice
    Windows 10 Access 2016
    Join Date
    Sep 2016
    Location
    Westfield, NJ
    Posts
    9
    I agree with your comments on capitalization. What I was talking about was the vba editor behaviour when it capitalizes while typing the word, not after the word is completed. So what I'm saying is typing docmd. after typin doc it capitalizes the d and c, not waiting until the whole word is typed. This happens when the editor is not working properly. When working properly the behaviour you described works perfectly, and your hint on including one cap in each variable name is a good one!

  7. #7
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    The behaviour you describe is indeed strange. Do any other applications show this behaviour? I have noticed that if there is something else running that puts a heavy load on the CPU, the screen display can lag behind the keyboard typing (sometimes by a lot), and can really mess things up.

    To the extent that you can, try running Access as the only open application to see what happens.

  8. #8
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    Do you know of a fix other than to not use the timer?
    I've never had the problem myself, but do struggle to understand why you would want the timer running when you are developing code. Perhaps I'm missing the point

  9. #9
    NJ-Tom is offline Novice
    Windows 10 Access 2016
    Join Date
    Sep 2016
    Location
    Westfield, NJ
    Posts
    9
    Hi John

    the only application that exhibits strange behaviour is the vba editor from access, I can't predict when it will happen, sometimes it starts up in the middle of a session, and restarting Access sometimes will fix it sometimes not.
    Another peculiar behaviour of the editor is when I type a word like docmd followed by an = sign followed by double quotes. I touch type, so when I look up what happens is the = sign is moved to right one space and the double quote gets paired and the insertion point get set back to the end of the word I typed before typing the = sign.

  10. #10
    NJ-Tom is offline Novice
    Windows 10 Access 2016
    Join Date
    Sep 2016
    Location
    Westfield, NJ
    Posts
    9
    The timer is on a form for which I may be writing vba code. I don't know if the timer stops when I'm in the editor. The timer is used to post the date and time on the form, the value of TIMER INTERVAL event is set to 1000 and ON TIMER event is set to thiis vba code Me.lblClock.Caption = Format(Now, "dddd, mmm d yyyy, hh:mm:ss AMPM")

  11. #11
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Weird. Maybe you have the twilight zone version of Access?

    You have A2016 so I can't check, but I'm wondering if you have some sort of strange autocorrect or autofill feature (and I use that word loosely) in effect. I don't see any VBA option for that in A2010. I have seen behaviour like that (doubling of quotes etc) in Web Page editors (e.g. Expression web).

    Beyond that, I'm baffled, too. Maybe one of our real experts here can offer some insight. I wish I could be of more help.

  12. #12
    warmslime is offline Advanced Beginner
    Windows 10 Access 2013
    Join Date
    Jan 2016
    Posts
    49
    For starters, does this happen on Excel or Word VBA for example?

  13. #13
    NJ-Tom is offline Novice
    Windows 10 Access 2016
    Join Date
    Sep 2016
    Location
    Westfield, NJ
    Posts
    9
    I haven't done a little in Excel and nothing in Word, mostly a couple of extensive Access applications. In my limited experience with Excel VBA I have not seen this behavior. As I said it is intermittent.

  14. #14
    NJ-Tom is offline Novice
    Windows 10 Access 2016
    Join Date
    Sep 2016
    Location
    Westfield, NJ
    Posts
    9
    If it is a twilight zone version, its been happening for quite some time, I had the problem with several access applications two different laptops, and one desktop, and Access versions 2010, 2013 and now 2016. I guess I'm surprised it is unique to me. The current desktop is a dell and the laptop is a lenovo x1 yoga, fairly new.

    I appreciate the thoughts and ideas everyone has provided.

    Tom

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

Similar Threads

  1. 2 similar queries acting different....
    By CQCDave in forum Queries
    Replies: 16
    Last Post: 04-29-2015, 01:05 PM
  2. Chart Not acting as you would expect
    By techtony in forum Reports
    Replies: 8
    Last Post: 08-08-2014, 02:22 PM
  3. Crosstab query acting up..?
    By snipe in forum Queries
    Replies: 4
    Last Post: 04-14-2014, 02:35 PM
  4. query is acting up
    By kwooten in forum Queries
    Replies: 20
    Last Post: 12-21-2011, 12:50 PM
  5. Update Query acting up
    By compooper in forum Queries
    Replies: 1
    Last Post: 07-04-2011, 12:27 PM

Tags for this Thread

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