I have an inherited form that I am updating. The query behind the form is changed in code, but is a simple select. However, on the form, when the records display, the very last record has #Name in the first field and Error in a few others. It returns the filtered records, but always with this last line and not sure how to get rid of it. Attached is a screen shot and below is the code.
Private Sub cboProgram_AfterUpdate()
On Error GoTo ErrorHandler
Dim strProgram As String
Dim strSelect As String
If Not IsNull(Me.cboProgram) And Me.cboProgram <> "<All>" Then
strProgram = Me.cboProgram.Column(0)
strSelect = strSelect & " WHERE Program = '" & strProgram & "' "
Me.RecordSource = strSelect
Me.Requery
ElseIf Me.cboProgram = "<All>" Then
Me.RecordSource = strSelect
Me.Requery
End If
Exit_ErrorHandler:
Exit Sub
ErrorHandler:
MsgBox "Error Number: " & Err.Number & " Description: " & Err.Description
Resume Exit_ErrorHandler
End Sub ProgramHistoryError.png
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
Jim Murphy
Programmer at Smart IT Solutions
When asked, what has been your best career decision?
Deciding to stick with EE.
Mohamed Asif
Technical Department Head
Being involved with EE helped me to grow personally and professionally.
Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question
Connect with Certified Experts to gain insight and support on specific technology challenges including: