S
spunkymuffmonkey
Hi there,
A user of a form that I have created suggested a change that would make life
easier for them, but I am struggling to achieve what is required.
When the user navigates between text formfields they sometimes accidentally
replace the text that is already present in that formfield.
To prevent this I have tried to utilise the AutoOpen macro to change the
ReplaceSelection option value to False when the document opens, and then
change the value back to True with a Document_Close macro, with very little
success unfortunately, the code I have been using is:
Sub AutoOpen()
Application.Options.ReplaceSelection = False
End Sub
and
Private Sub Document_Close()
Application.Options.ReplaceSelection = True
End Sub
The DocumentClose macro is really the part that is not working, although
when I run this code from the VBeditor it works, but not when I use it as
intended (i.e. when I simply close the document).
Would anybody please spare me the time to point out where I am going wrong,
or even a better way of acheiving what I am after.
Many thanks for looking!
A user of a form that I have created suggested a change that would make life
easier for them, but I am struggling to achieve what is required.
When the user navigates between text formfields they sometimes accidentally
replace the text that is already present in that formfield.
To prevent this I have tried to utilise the AutoOpen macro to change the
ReplaceSelection option value to False when the document opens, and then
change the value back to True with a Document_Close macro, with very little
success unfortunately, the code I have been using is:
Sub AutoOpen()
Application.Options.ReplaceSelection = False
End Sub
and
Private Sub Document_Close()
Application.Options.ReplaceSelection = True
End Sub
The DocumentClose macro is really the part that is not working, although
when I run this code from the VBeditor it works, but not when I use it as
intended (i.e. when I simply close the document).
Would anybody please spare me the time to point out where I am going wrong,
or even a better way of acheiving what I am after.
Many thanks for looking!