-----Original Message-----
Hi, Leonard! Please post the code behind the command button. If you
can, indicate on which line of the code the error is being raised.
Thanks Dirk
Here's the code.
The error is happening on the second last line:
DWCom.text = GoodText
The sub changetext is a routine to change proper nouns to
the student's own name and his/her etc...
-------------------------------------------------------
Private Sub UpDateWriting_Click()
Dim DWExtraC As String
Dim DWNotesC As String
Dim DWComC As String
Dim DWWillC As Integer
Dim DWProc As Integer
Dim DWEditC As Integer
Dim DWProofC As Integer
Dim DWGenreC As Integer
Dim DWSentC As Integer
Dim DWVocabC As Integer
Dim DWPuncC As Integer
Dim DWSpellC As Integer
Dim DWGenFeaC As Integer
Dim Text1 As String
Dim Text2 As String
Dim Text3 As String
Dim Text4 As String
Dim Text5 As String
Dim Text6 As String
Dim Text7 As String
Dim Text8 As String
Dim Text9 As String
Dim Text10 As String
Dim Text11 As String
Dim Text12 As String
Dim Text13 As String
Dim rawtext As String
DWWill.SetFocus
DWWillC = DWWill
DWPro.SetFocus
DWProc = DWPro
DWEdit.SetFocus
DWEditC = DWEdit
DWProof.SetFocus
DWProofC = DWProof
DWGenre.SetFocus
DWGenreC = DWGenre
DWSent.SetFocus
DWSentC = DWSent
DWVocab.SetFocus
DWVocabC = DWVocab
DWPunc.SetFocus
DWPuncC = DWPunc
DWSpell.SetFocus
DWSpellC = DWSpell
DWGenFea.SetFocus
DWGenFeaC = DWGenFea
Text1 = "During Daily Writing,"
Text2 = DLookup("DWWillCom", "DWWilling", "[DWWill] =" &
DWWillC)
' first is comment
' second is name of table
' third is reference, in this case and usually the key
field
Text3 = DLookup("DWProCom", "DWPro", "[DWpro] =" & DWProc)
Text4 = DLookup("DWEditCom", "DWEdit", "[DWEdit] =" &
DWEditC)
Text5 = DLookup("DWProofCom", "DWProof", "[DWProof] =" &
DWProofC)
Text6 = DLookup("DWGenreCom", "DWGenre", "[DWGenre] =" &
DWGenreC)
Text7 = vbCrLf & vbCrLf & "When analysing xstudent's
mechanics of writing, "
Text8 = Text7 & DLookup("DWSentCom", "DWSent", "[DWSent]
=" & DWSentC)
Text9 = DLookup("DWVocabCom", "DWVocab", "[DWVocab] =" &
DWVocabC)
Text10 = DLookup("DWPuncCom", "DWPunc", "[DWPunc] =" &
DWPuncC)
Text11 = DLookup("DWSpellCom", "DWSpell", "[DWSpell] =" &
DWSpellC)
Text12 = DLookup("DWGenFeaCom", "DWGenFea", "[DWGenFea] ="
& DWGenFeaC)
rawtext = Text1 & " " & Text2 & " " & Text3 & " " & Text4
& " " & Text5 & " " & Text6 & vbCrLf & Text8 & " " & Text9
& " " & Text10 & " " & Text11 & " " & Text12
Call ChangeText(rawtext)
DWCom.SetFocus
DWCom.text = GoodText
End Sub