comment out multiple lines of code

kidrobot

Registered User.
Local time
Today, 03:59
Joined
Apr 16, 2007
Messages
409
just a quick question. How do you comment out mult lines of code? In c++ it's */ then /* (something like that lol) ... but how do I do this in VBA.
 
Access does not have that capability however
In access 2000 and above there is an edit toolbar and if you select more than one line of code the toolbar will allow you to comment/uncomment the whole block.
 
There's also Conditional Compilation

#if 1=2 then

100 lines of code
debug this, and there should be no error

#end if
 
just a quick question. How do you comment out mult lines of code? In c++ it's */ then /* (something like that lol) ... but how do I do this in VBA.
On 11/13/2022, in Microsoft Access Professional 2019, to comment out multiple code lines, customize toolbar and add from the Edit Category: 'Comment Block' and 'UnComment Block'.
 
Hmmm. The previous post was 15 years ago??
 
I used this on my Access for a while now, I use it all the time. It will Rem out code that is blocked/selected and also Un-Rem, clear blocks of code.
Can't just recall how I set it but it must be easy. I'll look on that machine tomorrow and post the solution.
 
Would love it if the VBA IDE implemented regions
 
I used this on my Access for a while now, I use it all the time. It will Rem out code that is blocked/selected and also Un-Rem, clear blocks of code.
Can't just recall how I set it but it must be easy. I'll look on that machine tomorrow and post the solution.
As per post #6 ?
 
There are Comment and Uncomment Block toolbar buttons...
ss_comment.png


Drag and drop them onto your custom Debug toolbar in the IDE.
hth
 

Users who are viewing this thread

Back
Top Bottom