Hi
I have various forms which are set to Allowedits=False to prevent accidental overwriting of data. Each of these forms has a command button which changes Alloweditsto True. Now my boss wants to password protect these buttons for added security.
I have created a module that will create the inputbox and also check for the correct password, however when using the code below I am returned the error message Me is not allowed. From reading this forum I have gained the understanding that Me is specific to the current form and that I need to pass the forms name to the public code.
This is my first time with this passing of variables and I am clueless, so I would really appreciate some help and advice.
Public Sub passwordcheck_click()
Dim Message, Title, MyValue
Message="Enter Password" 'Set prompt.
Title="Password Check" 'Set Title.
'Display message,title
MyValue=InputBox(Message,Title)
If MyValue=241055 then
Me. Allowedits=True
End If
End Sub
I have various forms which are set to Allowedits=False to prevent accidental overwriting of data. Each of these forms has a command button which changes Alloweditsto True. Now my boss wants to password protect these buttons for added security.
I have created a module that will create the inputbox and also check for the correct password, however when using the code below I am returned the error message Me is not allowed. From reading this forum I have gained the understanding that Me is specific to the current form and that I need to pass the forms name to the public code.
This is my first time with this passing of variables and I am clueless, so I would really appreciate some help and advice.
Public Sub passwordcheck_click()
Dim Message, Title, MyValue
Message="Enter Password" 'Set prompt.
Title="Password Check" 'Set Title.
'Display message,title
MyValue=InputBox(Message,Title)
If MyValue=241055 then
Me. Allowedits=True
End If
End Sub