Spell-check within a form error

G

Guest

Here is the code I compiled from several posts:

'Private Sub Project_Summary_AfterUpdate()
' With Me.Project_Summary
' .SetFocus
' If Len(.Text) > 0 Then
' .SelStart = 0: .SelLength = Len(.Text)
' DoCmd.SetWarnings False
' DoCmd.RunCommand acCmdSpelling
' DoCmd.SetWarnings True
' End If
' End With
'End Sub

If I update the field and misspell a word, the spell checking dialog comes
up and selects the misspelled word. However, if I click on "change", I get
the following error:

"The macro or funciton set to the BeforeUpdate or ValidationRule property
for this field is preventing Department Status Database from saving the data
in the field.

*If this is a macro, open the macro in the Macro window and remove the
action that forces a save (for example, GoToControl).
*If the macro includes a SetValue action, set the macro to the AfterUpdate
property of the control instead.
*If this is a function, redefine the function in the Module window."

The form and field are set to allow edits and there are no other macros
associated with that field on the form (no SetValues or GoToControls). The
field is set as a Memo, but I tried changing it to Text and get the same
error.

Can anyone help?
 
G

Guest

Hi

Is there any before_update code for the field or for the form?

Or, if you look at the table design, does this field have a validation rule?

Regards

Andy Hull
 
M

missinglinq via AccessMonster.com

I think Andy's advice is spot on; this has nothing to do with spell checking,
but rather with the data not complying with a validation rule. Check the two
places he mentions and also go to Properties - Data
of the control and check the Validation Rule property.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top