The form I've build contains an option group with vb code to filter through the last name records for end user ease. The code to filter works, however when searching and viewing the data the last name field on some of my data changes to numerics.
See code below:
Private Sub alphabar_AfterUpdate()
On Error GoTo alphabar_AfterUpdate_Err
If (alphabar = 1) Then
' Filter last names that start with A.
DoCmd.ApplyFilter "", "[tblTest]![strLastName] Like ""A*"""
End If
If (RecordsetClone.RecordCount > 0) Then
' If records are returned for the selected letter, go to the AlphaBar control.
DoCmd.GoToControl "alphabar"
' Stop the macro.
Exit Sub
End If
alphabar_AfterUpdate_Exit:
Exit Sub
alphabar_AfterUpdate_Err:
MsgBox Error$
Resume alphabar_AfterUpdate_Exit
End Sub
Please Help!
See code below:
Private Sub alphabar_AfterUpdate()
On Error GoTo alphabar_AfterUpdate_Err
If (alphabar = 1) Then
' Filter last names that start with A.
DoCmd.ApplyFilter "", "[tblTest]![strLastName] Like ""A*"""
End If
If (RecordsetClone.RecordCount > 0) Then
' If records are returned for the selected letter, go to the AlphaBar control.
DoCmd.GoToControl "alphabar"
' Stop the macro.
Exit Sub
End If
alphabar_AfterUpdate_Exit:
Exit Sub
alphabar_AfterUpdate_Err:
MsgBox Error$
Resume alphabar_AfterUpdate_Exit
End Sub
Please Help!