- Local time
- Today, 06:26
- Joined
- Jul 9, 2003
- Messages
- 16,886
I understand that Microsoft will be blocking VBA soon, in all files from the web. - Re "Mark of the Web."
I was wondering if there was a way round the the Microsoft induced problem for downloaded MS Access databases containing VBA. I thought, how would Windows know if an MS Access dB contained VBA? I wondered, could it be if a controls event procedure had:- [Event Procedure] in it? Or maybe Windows looks to see if there are active Modules? I don't know, but it occurred to me that a bit of code could be written that could replace:- [Event Procedure] with an empty string "" Maybe that would be good enough to allow the dB to be imported.
I was experimenting with the following code:- (the message box represents capturing the information and storing it in a table ready to add back in to the form later)
It Dawned on me that I wouldn't be able to send this VBA code through with the database anyway! But I might be able to get around that by having a separate database which operates on other dB's remotely.
Any observations, comments, criticisms and advise most welcome!!
I was wondering if there was a way round the the Microsoft induced problem for downloaded MS Access databases containing VBA. I thought, how would Windows know if an MS Access dB contained VBA? I wondered, could it be if a controls event procedure had:- [Event Procedure] in it? Or maybe Windows looks to see if there are active Modules? I don't know, but it occurred to me that a bit of code could be written that could replace:- [Event Procedure] with an empty string "" Maybe that would be good enough to allow the dB to be imported.
I was experimenting with the following code:- (the message box represents capturing the information and storing it in a table ready to add back in to the form later)
Code:
Private Sub Command1_Click()
'Form_Form1.TestCtrl.OnClick = ""
Dim strFrmName As String
strFrmName = "Form1"
DoCmd.OpenForm strFrmName, acDesign, , , , acHidden
With Forms(strFrmName)
MsgBox " >>> " & .TestCtrl.OnClick
.TestCtrl.OnClick = ""
.TestCtrl.Enabled = False
End With
DoCmd.Close acForm, strFrmName, acSaveYes
DoCmd.OpenForm strFrmName
End Sub
It Dawned on me that I wouldn't be able to send this VBA code through with the database anyway! But I might be able to get around that by having a separate database which operates on other dB's remotely.
Any observations, comments, criticisms and advise most welcome!!