I have an information form that is set to open "AfterUpdate" of the Book ID control on my original Checkout Form. This part I have working well at this point. However, on the information form, which basically serves to double-check what was entered in "Book ID", I have Yes and No buttons. The Yes button I have set to close the information form, return to Checkout Form at set focus on another field down the form. The No button I would like to set to return to the Book ID control, but it won't seem to do that. Is that because the original procedure is connected to "AfterUpdate"?
Here's the code in place for the two buttons:
Code:
Private Sub Close_Yes_Click()
On Error GoTo Err_Close_Yes_Click
If Me.Dirty Then Me.Dirty = False
Forms![Checkout Form]![OutDate].SetFocus
DoCmd.Close
Exit_Close_Yes_Click:
Exit Sub
Err_Close_Yes_Click:
MsgBox Err.Description
Resume Exit_Close_Yes_Click
End Sub
Private Sub No_Button_Click()
On Error GoTo Err_No_Button_Click
If Me.Dirty Then Me.Dirty = False
Forms![Checkout Form]![Book ID].SetFocus
DoCmd.Close
Exit_No_Button_Click:
Exit Sub
Err_No_Button_Click:
MsgBox Err.Description
Resume Exit_No_Button_Click
End Sub
.
My other instance is very similar, except that I'm trying to use a macro to do basically the same thing. In the original macro that is opening the information form (running "AfterUpdate" of Book ID), I'm opening a message box if the Book ID is not found in the database at all (as opposed to the wrong one that would still bring up a record), and would like to return to the Book ID control after the message box is closed. In both cases, the control always returns to the control that comes after the Book ID control. Same problem?
If so, how do I do this?
Thanks for your help. You guys are great!