Hello
I'm getting this error on my form Error 2467 The expression you entered refers to an object that is closed or doesn't exist. This was working before fine. Here is the vba
Private Sub Command18_Click()
On Error GoTo Err_Command18_Click
DoCmd.GoToRecord , , acNewRec
Exit_Command18_Click:
Exit Sub
Err_Command18_Click:
MsgBox Err.Description
Resume Exit_Command18_Click
End Sub
Private Sub Command19_Click()
On Error GoTo Err_Command19_Click
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Exit_Command19_Click:
Exit Sub
Err_Command19_Click:
MsgBox Err.Description
Resume Exit_Command19_Click
End Sub
Private Sub Command20_Click()
On Error GoTo Err_Command20_Click
DoCmd.Close
Exit_Command20_Click:
Exit Sub
Err_Command20_Click:
MsgBox Err.Description
Resume Exit_Command20_Click
End Sub
Private Sub Form_AfterUpdate()
On Error GoTo Err_Handler
'Purpose: Requery the combo that may have called this in its DblClick
Dim cbo As ComboBox
Dim iErrCount As Integer
Const strcCallingForm = "TabRefundRequestForm"
If CurrentProject.AllForms(strcCallingForm).IsLoaded Then
Set cbo = Forms(strcCallingForm)![HSS Number]
cbo.Requery
End If
Exit_Handler:
Exit Sub
Err_Handler:
'Undo the combo if it has a partially entered value.
If (Err.Number = 2118) And (iErrCount < 3) And Not (cbo Is Nothing) Then
cbo.Undo
Resume
End If
MsgBox "Error " & Err.Number & ": " & Err.Description
Resume Exit_Handler
End Sub
Private Sub Form_BeforeDelConfirm(Cancel As Integer, Response As Integer)
If Response = acDeleteOK Then
Call Form_AfterUpdate
End If
End Sub
Private Sub Form_BeforeUpdate(Cancel As Integer)
On Error GoTo Err_Form_BeforeUpdate_Error
If Nz(Me.[User], 0) = 0 Then
MsgBox "Please enter User Name!!!"
Cancel = True
User.SetFocus
Exit Sub
End If
If Nz(Me.[HSS Number], 0) = 0 Then
MsgBox "Please enter Hss Number!!!"
Cancel = True
[HSS Number].SetFocus
Exit Sub
End If
If Nz(Me.[PatientName], 0) = 0 Then
MsgBox "Please enter Patient Name!!!"
Cancel = True
[PatientName].SetFocus
Exit Sub
End If
If Nz(Me.[PatientLastName], 0) = 0 Then
MsgBox "Please enter Last Name!!!"
Cancel = True
[PatientLastName].SetFocus
Exit Sub
End If
If Nz(Me.[Address], 0) = 0 Then
MsgBox "Please enter Address!!!"
Cancel = True
[Address].SetFocus
Exit Sub
End If
Exit_ErrorHandler:
Exit Sub
Err_Form_BeforeUpdate_Error:
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure Form_BeforeUpdate of VBA Document Form T_PatientDemographicsForm at Line " & Erl
Resume Exit_ErrorHandler
End Sub