D
Deleted member 147267
Guest
You are passing an object (the control); i.e. Public Function SpellChecker(txt As TextBox) As Boolean
I'm saying I would pass what the control contains (see note at end)
Public Function SpellChecker(strText As String) As Boolean
The million dollar question is, will its value work or do you still need .Text? I see no reason why you can't be successful with
Call SpellChecker(Me.PositionTitle) as long as the default property is what is passed (its .Value property is the default). If that didn't work I'd be surprised but would then try
Call SpellChecker(Me.PositionTitle.Value) OR assign Me.PositionTitle value to a string variable and pass that.
Note: You are using stuff I've never played with, so maybe you have a valid reason for passing the control itself. You would have to re-write your With block code if you don't pass the control. I just noticed that in there, you're invoking DoCmd.RunCommand acCmdSpelling which is something I haven't done. I also see that you are having to set the focus to the control and select the (now) Text in order to do that. I have to wonder if that's all necessary or can you just spell check the string I'm talking about passing instead.
I'm saying I would pass what the control contains (see note at end)
Public Function SpellChecker(strText As String) As Boolean
The million dollar question is, will its value work or do you still need .Text? I see no reason why you can't be successful with
Call SpellChecker(Me.PositionTitle) as long as the default property is what is passed (its .Value property is the default). If that didn't work I'd be surprised but would then try
Call SpellChecker(Me.PositionTitle.Value) OR assign Me.PositionTitle value to a string variable and pass that.
Note: You are using stuff I've never played with, so maybe you have a valid reason for passing the control itself. You would have to re-write your With block code if you don't pass the control. I just noticed that in there, you're invoking DoCmd.RunCommand acCmdSpelling which is something I haven't done. I also see that you are having to set the focus to the control and select the (now) Text in order to do that. I have to wonder if that's all necessary or can you just spell check the string I'm talking about passing instead.