Hello,
I have a form, "frm_Axis_Info", which has an unbound text box, "Axis_Search", the user can type in an Axis Number and press enter. It opens another form "frm_Axes" to this specific record.
It works great, except for the fact my users can not navigate through different records once "frm_axes" has opened. It only displays the record they were looking for and gives an error message ("You can't go to the specified record") if they try to navigate next or previous. There are hundreds of in "frm_Axes" but my code is limiting them only to the Axis Number they were looking for.
What am I doing wrong?
Code:
Private Sub Axis_Search_AfterUpdate()
If IsNull(Me.Axis_Search) Or Me.Axis_Search = "" Then
MsgBox "Please enter an Axis Number"
Me.Axis_Search.SetFocus
Cancel = True
Exit Sub
End If
If DCount("[AxisNumber]", "tbl_Axes", "AxisNumber = " & Me.Axis_Search) = 0 Then
MsgBox "Please enter a Valid Axis Number"
Me.[AxisNumber].SetFocus
Cancel = True
Exit Sub
End If
DoCmd.OpenForm "frm_Axes", , , "AxisNumber = " & Me.Axis_Search
DoCmd.Close acForm, "frm_Axis_Info"
End Sub
Thank you for your help