VBA Issues in Windows 11 (1 Viewer)

kenrav

New member
Local time
Yesterday, 22:46
Joined
Jun 20, 2020
Messages
19
I recently upgraded to Windows 11. I'm fully updated and have the latest Office 365 updates as well. Unfortunately, I'm finding that my "DoCmd.SetWarnings True" VBA actions no longer work in all my legacy Access apps. The action still works fine on my Windows 10 and Server 2019 devices. Anyone else experiencing this (or other VBA issues?)

Thanks!
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 00:46
Joined
Feb 28, 2001
Messages
23,210
What does it do or not do? Does it not issue warnings when you expected it to? Or does it issue a warning when you tell it to enable warnings? Or something else?
 

Ranman256

Well-known member
Local time
Today, 01:46
Joined
Apr 9, 2015
Messages
4,123
you tried it in a macro and VBA? both fail?
 

kenrav

New member
Local time
Yesterday, 22:46
Joined
Jun 20, 2020
Messages
19
I wrote a small app for testing:

strSQL = "Update tblTest Set Field2 = #" & Now & "#"
DoCmd.SetWarnings True
DoCmd.RunSQL strSQL

On my Windows 10 and Server 2019 devices, Windows displays a warning message (after line 3) that 1 record is being updated (see attached screen shot) which is what I want to happen. However, this is not working under Windows 11.
 

Attachments

  • SetWarnings Message.jpg
    SetWarnings Message.jpg
    14.7 KB · Views: 16

moke123

AWF VIP
Local time
Today, 01:46
Joined
Jan 11, 2013
Messages
2,910
where do you set warnings false?

your turning them on with set warnings true

Code:
DoCmd.SetWarnings false

strSQL = "Update tblTest Set Field2 = #" & Now & "#"
DoCmd.RunSQL strSQL

DoCmd.SetWarnings True

edit: you want the message? don't bother with the set warnings.
 
Last edited:

kenrav

New member
Local time
Yesterday, 22:46
Joined
Jun 20, 2020
Messages
19
All,

Keep in mind that this isn't a coding issue. Many of my apps have been around for years.

The issue is that these apps display the desired warnings on previous versions of Windows but not on Windows 11.

I'm just curious whether anyone has seen anything unusual in Windows 11 with regard to VBA? The culprit could be my new Dell XPS laptop.
 

kenrav

New member
Local time
Yesterday, 22:46
Joined
Jun 20, 2020
Messages
19
The default is true.
You are correct.

I just ran this 2-line script:

strSQL = "Update tblTest Set Field2 = #" & Now & "#"
DoCmd.RunSQL strSQL

Message displayed under Windows 10 and Server 2019, but not Windows 11.
 

moke123

AWF VIP
Local time
Today, 01:46
Joined
Jan 11, 2013
Messages
2,910
can't say I've ever experienced it but I've never used runsql. I prefer .execute method.
 

cheekybuddha

AWF VIP
Local time
Today, 06:46
Joined
Jul 21, 2014
Messages
1,098
Might you have messed inadvertently with the Access Options?

under 'Advanced' there is:
1659738981547.png


It may look a bit different on your version of Access
 

Attachments

  • 1659738831681.png
    1659738831681.png
    41.1 KB · Views: 8

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 13:46
Joined
May 7, 2009
Messages
16,875
on Access 2021 it is in Client Setting from Access Option menu:

option1.png
 

kenrav

New member
Local time
Yesterday, 22:46
Joined
Jun 20, 2020
Messages
19
Yep! "Action queries" was disabled. Enabled it and all works fine. Since I know I didn't disable it, I wonder if installing MS 365 on my new laptop (or perhaps a recent update) disabled it? Regardless, thanks for your help!
 

Users who are viewing this thread

Top Bottom