Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Line out code

Posted on 2013-12-09
7
Medium Priority
?
384 Views
Last Modified: 2013-12-09
Is it advisable to also line out the event and End sub thereby completely removing any event?  Not sure if there could be a conflict if Access "sees" an event but there is nothing to execute.  

Private Sub Form_BeforeUpdate(Cancel As Integer)
'codes here
End Sub

is it advisable to do this: (rem out Private and End Sub)
'Private Sub Form_BeforeUpdate(Cancel As Integer)
'codes here
'End Sub
0
Comment
Question by:pdvsa
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
7 Comments
 
LVL 18

Accepted Solution

by:
Jerry Miller earned 600 total points
ID: 39706877
I will usually comment the code inside the event rather than entire event, but they both will do basically the same thing. The only difference that I can think of is you will generate errors if something else is calling the event and you have it commented (lined out).
0
 
LVL 18

Expert Comment

by:Jerry Miller
ID: 39706880
If the event is not commented, Access will see the event and run it at the appropriate time but nothing will happen since there is no code to execute.
0
 
LVL 75
ID: 39706886
Unless you have [Event Procedure] on the Property sheet of a Form or Control on the Form, no code will execute.  If you are no longer using the event, then delete the code. Less Is More.

mx
0
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 

Author Comment

by:pdvsa
ID: 39707038
I only thought to keep the event and comment out the code to show that I did try to do whatever it was and decided it was not the way to go and had no other additional code there.
0
 
LVL 75

Assisted Solution

by:DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 600 total points
ID: 39707049
Well, nothing  wrong with commenting out the code for your own (or others) historical reasons.
0
 

Author Closing Comment

by:pdvsa
ID: 39707070
thank you.
0
 
LVL 18

Expert Comment

by:Jerry Miller
ID: 39707435
I do that sometimes. Leave attempted solutions commented out with notes as to why it didn't work. I usually remove all of that in the production copy though. I maintain two copies of everything; one that is a direct copy of the working production code and another that has all of my development 'stuff'.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question