Can not make ACCDE (1 Viewer)

smtazulislam

Member
Local time
Today, 02:32
Joined
Mar 27, 2020
Messages
806
If there are any comments between the header and End line, Access won't delete them automatically.
If the procedures contains nothing but comments either delete it completely or also comment out the First and last lines.

BTW the first line should be Private Sub cmdDelete_Click. As written, your code won't compile so an ACCDE won't ever be created.

Have you added Option Explicit as the second line in each code module and then compiled your project correcting all errors?
I forgot to wrote "Sub".
I have "Option Explicit".But my question is if I block all code and I try to debug > Compile then dont have any error. It have any problem to create .accde file.

or I should delete code block range
Thank you.

Code:
Option Compare Database
Option Explicit

Private Sub chkCurrentYear_AfterUpdate()
'If (chkCurrentYear.Value) = 0 Then
'    Me.cboYears.Enabled = True
'Else
'    Me.cboYears.Enabled = False
'End If
End Sub
 

Isaac

Lifelong Learner
Local time
Yesterday, 16:32
Joined
Mar 14, 2017
Messages
8,777
"if I block all code" - do you mean "if I comment out all code" ?
 

isladogs

MVP / VIP
Local time
Today, 00:32
Joined
Jan 14, 2017
Messages
18,218
I've already answered the question in post #21 but to repeat you have two choices:

EITHER
1. Delete the entire procedure as it only contains comments and is doing nothing.
OR
2. Keep it but also comment out the first & last lines:
Rich (BB code):
'Private Sub chkCurrentYear_AfterUpdate()
'If (chkCurrentYear.Value) = 0 Then
'    Me.cboYears.Enabled = True
'Else
'    Me.cboYears.Enabled = False
'End If
'End Sub

Both of those should allow you to create an ACCDE (unless there are other issues).
All comments are removed when an ACCDE is created so the end result will be identical in each case
The only point in doing the second method is if you think you might need to reinstate the procedure in a future version.
If not get rid of it completely
 

smtazulislam

Member
Local time
Today, 02:32
Joined
Mar 27, 2020
Messages
806
I've already answered the question in post #21 but to repeat you have two choices:

EITHER
1. Delete the entire procedure as it only contains comments and is doing nothing.
OR
2. Keep it but also comment out the first & last lines:
Rich (BB code):
'Private Sub chkCurrentYear_AfterUpdate()
'If (chkCurrentYear.Value) = 0 Then
'    Me.cboYears.Enabled = True
'Else
'    Me.cboYears.Enabled = False
'End If
'End Sub

Both of those should allow you to create an ACCDE (unless there are other issues).
All comments are removed when an ACCDE is created so the end result will be identical in each case
The only point in doing the second method is if you think you might need to reinstate the procedure in a future version.
If not get rid of it completely
Thank you.
Now I understand and have answered it.
Because, I want to use this code later, for that I block code.
Thanks again for deeply explained .
 

Users who are viewing this thread

Top Bottom