
Object Variable With Variable Not Defined Error
Greetings,
After I run a userform and click the OK button I get an error message
that the Object Variable or With Variable is not defined.
However, the userform enters the appropriate info into the document
which makes me think it may be the "Me.Hide" that's causing the
problem? The
VBA help isn't being much help.
Here's the code for the button on the form:
Private Sub CommandButton1_Click()
'set variables for each text box on form
vName = frmClientInfo.tBox_Name.Text
vDate = frmClientInfo.tBox_Date.Text
vSSN = frmClientInfo.tBox_SSN.Text
vBegin = frmClientInfo.tBox_BegTime.Text
vEnd = frmClientInfo.tBox_EndTime.Text
vTotal = frmClientInfo.tBox_TotTime.Text
'place textbox values into the document
ActiveDocument.FormFields("bkName").Result = vName
ActiveDocument.FormFields("bkDate").Result = vDate
ActiveDocument.FormFields("bkSSN").Result = vSSN
ActiveDocument.FormFields("bkBegTime").Result = vBegin
ActiveDocument.FormFields("bkEndTime").Result = vEnd
ActiveDocument.FormFields("bkTotTime").Result = vTotal
Me.Hide
End Sub
TIA,
Jim Adams
Maysville KY USA