Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why does this keep telling me "Object Required"? 2

Status
Not open for further replies.

johngalt69austin

Technical User
Apr 6, 2004
7
US
What am I missing here?

Private Sub CloseForm_Click()
On Error GoTo Err_CloseForm_Click


Dim STCA As String


If Me!STCA Is Null Then

MsgBox "You Did Not Enter A Short Term Corrective Action", , vbCritical
DoCmd.GoToControl Me.STCA
Else

DoCmd.Close acForm, frmEngByNCNo, acSaveYes

End If




Exit_CloseForm_Click:
Exit Sub

Err_CloseForm_Click:
MsgBox Err.Description
Resume Exit_CloseForm_Click


End Sub
 
telling me "Object Required"
And what is the highlighted line of code ?
Anyway, try to replace this:
If Me!STCA Is Null Then
By this:
If IsNull(Me!STCA) Then

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
You are also using both "." and "!" to reference the SCTA control. I believe "!" is correct - the "." would mean a property or method of the form whereas "!" is a shortcut to reference a control on the form (versus using the Controls property).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top