VBA in Windows 11

Hello . Some time ago I built a database with ms access for my library books. The laptop I have has genuine Windows 10, with an i7 processor and Microsoft Office LTSC Professional Plus 2021. The database uses vba code, especially in the on current events in the forms. I recently bought a new i9 laptop with genuine windows 11 and installed the same office and database. UNFORTUNATELY THE VBA CODE IS NOT WORKING. Any advice is invaluable. I'm in a dead end . Thanks in advance..

Here is a sample of VBA code :

Select Case Me.Exists 'the name of the control with the value to be tested

Case "NOΙ"

Me.Exists.ForeColor = RGB(255, 0, 0) '(red)

Me.Emoji.Picture = "C:\network21\Epix_Database\Images\BooksCovers\Emoji_No.jpg"

Case "YESΙ"

Me.Exists.ForeColor = RGB(0, 0, 0) ' (black)

Me.Emoji.Picture = "C:\network21\Epix_Database\Images\BooksCovers\Emoji_Yes.jpg"

End Select

|

There is nothing wrong with this code. "Is not working" is not very helpful. What exactly is (not) happening?

Can you compile the code (VBA window > Debug > Compile)?
Do you have any broken references (VBA window > Tools > References)?

Is the app in a Trusted Location (Access window > File > Options > Trust Center > Trusted Locations)?

-Tom.
Microsoft Access MVP
Phoenix, AZ

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

In addition to answering Tom's questions, please indicate whether your new computer has 32 bit Access installed or 64 bit Access installed.

When asking about problems, it is almost always helpful to include:

Specifically what you expect to happen in a specific procedure.

Specifically what actually occurred: errors? wrong results? nothing?

Specifically, which line in which procedure produces the error.

The actual error message displayed, if one occurs.

That kind of information is like opening a closed box and shining a flashlight inside it to see what's actually there. Otherwise, we're just staring at the box....

With Joy Wend Your Way

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Are you sure, there is a folder on the new laptop named Network21?

Hope this helps,
Scott<>
Blog: http://scottgem.wordpress.com
Microsoft Access MVP since 2007

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

 
 

Question Info


Last updated April 28, 2024 Views 62 Applies to: