Lost Focus when requering
frmViewEventHistory is a continuous form with Pop Up = Yes and Modal = Yes. While viewing the form and you double click a row it will open fdlgEventDetails form (that is also Pop Up = yes and Modal = Yes). That’s okay.
After closing fdlgEventDetail, you’re back on your continous form, but at the first record—not the record last on when double-clicked. It’s becoming annoying when you have a lot of records and have to figure out where you were.
How do I get it to go back to the record I was on?
Below is my unload code for fdlgEventDetail:
frmViewEventHistory is a continuous form with Pop Up = Yes and Modal = Yes. While viewing the form and you double click a row it will open fdlgEventDetails form (that is also Pop Up = yes and Modal = Yes). That’s okay.
After closing fdlgEventDetail, you’re back on your continous form, but at the first record—not the record last on when double-clicked. It’s becoming annoying when you have a lot of records and have to figure out where you were.
How do I get it to go back to the record I was on?
Below is my unload code for fdlgEventDetail:
Code:
Private Sub Form_Unload(Cancel As Integer)
On Error GoTo ErrorHandler
If CurrentProject.AllForms("frmViewEventHistory").IsLoaded Then
Forms!frmViewEventHistory.Requery
End If
CleanUpAndExit:
Exit Sub
ErrorHandler:
Call MsgBox("An error was encountered" & vbCrLf & vbCrLf & _
"Description: " & Err.Description & vbCrLf & _
"Error Number: " & Err.Number, vbCritical, gstrAppTitle)
Resume CleanUpAndExit
End Sub
Last edited: