Thank you. I did as you suggested, including making a copy of the code before deleting, and then went about it.…
All seems fine and the database seems to open as normal. I was sure it was ok to delete it.. but confirmation from you gave me the nerve to do it.. LOL
There won't be a reference, at least on newer versions of access, if the code is removed and you do a C&R.
A compact and repair should remove any totally empty code modules. It won't if there are comments still present.
Just FYI, I could be wrong, and it may not even apply to the OP's particular situation, but I think empty subs are required when you use classes and sink events (With Events). No?
There won't be a reference, at least on newer versions of access, if the code is removed and you do a C&R.
A compact and repair should remove any totally empty code modules. It won't if there are comments still present.
Just FYI, I could be wrong, and it may not even apply to the OP's particular situation, but I think empty subs are required when you use classes and sink events (With Events). No
The sub stubs are not required, but the event property must be set to "Event Procedures". Or the event will not be raised.
So if you are trapping the deletecurrentcontact click event, you either need to add "[event procedure]" manually or you can do it in code from the class that traps the event. DeleteCurrentContact
For example this class traps a lot of event from different objects. In the class module I make sure to add the event handler property
Code:
Public Sub InitalizeFilterCombo(TheComboBox As Access.ComboBox, Optional FilterFieldName As String = "All_Fields", _
Optional TheSearchType As SearchType = SearchType.anywhereinstring, _
Optional HandleArrows As Boolean = True, _
Optional HandleInternationalCharacters As Boolean = True)
On Error GoTo errLabel
Dim rs As DAO.Recordset
If Not TheComboBox.RowSourceType = "Table/Query" Then
MsgBox "This class will only work with a combobox that uses a Table or Query as the Rowsource"
Exit Sub
End If
Set mCombo = TheComboBox
Set mForm = TheComboBox.Parent
mHandleArrows = HandleArrows
mAutoCompleteEnabled = True
mHandleInternationalCharacters = HandleInternationalCharacters
'HandleArrows allows you to use the arrow keys to move up and down without selecting the value
mCombo.OnClick = "[Event Procedure]"
If mHandleArrows = True Then
mCombo.OnKeyDown = "[Event Procedure]"
mCombo.OnClick = "[Event Procedure]"
End If
mFilterFieldName = FilterFieldName
mSearchType = TheSearchType
mForm.OnCurrent = "[Event Procedure]"
mForm.OnClose = "[Event Procedure]"
mCombo.OnGotFocus = "[Event Procedure]"
mCombo.OnChange = "[Event Procedure]"
mCombo.OnClick = "[Event Procedure]"
mCombo.AfterUpdate = "[Event Procedure]"
mForm.OnClose = "[Event Procedure]"
The sub stubs are not required, but the event property must be set to "Event Procedures". Or the event will not be raised.
So if you are trapping the deletecurrentcontact click event, you either need to add "[event procedure]" manually or you can do it in code from the class that traps the event. DeleteCurrentContact
For example this class traps a lot of event from different objects. In the class module I make sure to add the event handler property
Code:
Public Sub InitalizeFilterCombo(TheComboBox As Access.ComboBox, Optional FilterFieldName As String = "All_Fields", _
Optional TheSearchType As SearchType = SearchType.anywhereinstring, _
Optional HandleArrows As Boolean = True, _
Optional HandleInternationalCharacters As Boolean = True)
On Error GoTo errLabel
Dim rs As DAO.Recordset
If Not TheComboBox.RowSourceType = "Table/Query" Then
MsgBox "This class will only work with a combobox that uses a Table or Query as the Rowsource"
Exit Sub
End If
Set mCombo = TheComboBox
Set mForm = TheComboBox.Parent
mHandleArrows = HandleArrows
mAutoCompleteEnabled = True
mHandleInternationalCharacters = HandleInternationalCharacters
'HandleArrows allows you to use the arrow keys to move up and down without selecting the value
mCombo.OnClick = "[Event Procedure]"
If mHandleArrows = True Then
mCombo.OnKeyDown = "[Event Procedure]"
mCombo.OnClick = "[Event Procedure]"
End If
mFilterFieldName = FilterFieldName
mSearchType = TheSearchType
mForm.OnCurrent = "[Event Procedure]"
mForm.OnClose = "[Event Procedure]"
mCombo.OnGotFocus = "[Event Procedure]"
mCombo.OnChange = "[Event Procedure]"
mCombo.OnClick = "[Event Procedure]"
mCombo.AfterUpdate = "[Event Procedure]"
mForm.OnClose = "[Event Procedure]"