E
Emma Aumack
Hi All,
I have a form on which there are several "Flag" text fields which users use
to mark records. Next to each flag field there is a clear button that runs
the following code:
Private Sub btn_ClSA1Flag1_Click()
On Error GoTo Err_btn_ClSA1Flag1_Click
Dim stDocName As String
stDocName = "QryUpd_ClearSA1Flag1"
DoCmd.OpenQuery stDocName, acNormal, acEdit
Me.Requery
'DoCmd.OpenQuery stDocName, acNormal, acEdit
Exit_btn_ClSA1Flag1_Click:
Exit Sub
Err_btn_ClSA1Flag1_Click:
msgbox Err.Description
Resume Exit_btn_ClSA1Flag1_Click
End Sub
As it is, if I am in the last record that was "Flagged" and I click on the
clear button, that records Flag field does not get cleared. But when I
uncomment the second docmd.runquery (which runs the update query that clears
the flag field) it clears everything because I am no longer on the last
flagged records flag field. How do I get the last flagged field cleared,
without having to move off of the record and running the docmd.runquery
twice??
Thanks for your help.
Emma
I have a form on which there are several "Flag" text fields which users use
to mark records. Next to each flag field there is a clear button that runs
the following code:
Private Sub btn_ClSA1Flag1_Click()
On Error GoTo Err_btn_ClSA1Flag1_Click
Dim stDocName As String
stDocName = "QryUpd_ClearSA1Flag1"
DoCmd.OpenQuery stDocName, acNormal, acEdit
Me.Requery
'DoCmd.OpenQuery stDocName, acNormal, acEdit
Exit_btn_ClSA1Flag1_Click:
Exit Sub
Err_btn_ClSA1Flag1_Click:
msgbox Err.Description
Resume Exit_btn_ClSA1Flag1_Click
End Sub
As it is, if I am in the last record that was "Flagged" and I click on the
clear button, that records Flag field does not get cleared. But when I
uncomment the second docmd.runquery (which runs the update query that clears
the flag field) it clears everything because I am no longer on the last
flagged records flag field. How do I get the last flagged field cleared,
without having to move off of the record and running the docmd.runquery
twice??
Thanks for your help.
Emma