J
Jim Franklin
Hi, I wonder if anyone can help me with this?
Using A2K, I have a continuous form, which is constantly requeried every 10
seconds using the timer event.
I would like the currently selected record to be clearly shown. I have
therefore a field [JOB_SELECTED] in my source table. This records the
currently selected record by using the following code in the forms OnCurrent
event:
If Me!JOB_SELECTED = False Then
DoCmd.OpenQuery "qry_Jobs_Reset_Selected", acViewNormal (update
query for all records on form)
Me.Refresh
Me!JOB_SELECTED = True
DoCmd.RunCommand acCmdSaveRecord
End If
I then use Conditional Formatting for each control to change colours when
JOB_SELECTED=true. This works fine.
However, when my form source data is requeried, I want the currently
selected record BEFORE the requery to remain selected afterwards (assuming
the record is still there.) My timer event code therefore is:
MyStr = Me!Ticket_Ref
Me.Requery
Set rs = Me.Recordset.Clone
rs.FindFirst "[Ticket_Ref] = '" & MyStr & "'"
Me.Bookmark = rs.Bookmark
Without my OnCurrent event this also works fine. However, when I use the two
together, I get the following error: "Run Time Error 7878: The data has
been changed.", stopping at the Me!JOB_SELECTED = True line of my OnCurrent
event. This occurs the next time the Timer event fires after I have changed
the current record.
Hope this all makes sense!
If anyone has any suggestions, I would be very grateful. Thanks for reading,
Jim F.
Using A2K, I have a continuous form, which is constantly requeried every 10
seconds using the timer event.
I would like the currently selected record to be clearly shown. I have
therefore a field [JOB_SELECTED] in my source table. This records the
currently selected record by using the following code in the forms OnCurrent
event:
If Me!JOB_SELECTED = False Then
DoCmd.OpenQuery "qry_Jobs_Reset_Selected", acViewNormal (update
query for all records on form)
Me.Refresh
Me!JOB_SELECTED = True
DoCmd.RunCommand acCmdSaveRecord
End If
I then use Conditional Formatting for each control to change colours when
JOB_SELECTED=true. This works fine.
However, when my form source data is requeried, I want the currently
selected record BEFORE the requery to remain selected afterwards (assuming
the record is still there.) My timer event code therefore is:
MyStr = Me!Ticket_Ref
Me.Requery
Set rs = Me.Recordset.Clone
rs.FindFirst "[Ticket_Ref] = '" & MyStr & "'"
Me.Bookmark = rs.Bookmark
Without my OnCurrent event this also works fine. However, when I use the two
together, I get the following error: "Run Time Error 7878: The data has
been changed.", stopping at the Me!JOB_SELECTED = True line of my OnCurrent
event. This occurs the next time the Timer event fires after I have changed
the current record.
Hope this all makes sense!
If anyone has any suggestions, I would be very grateful. Thanks for reading,
Jim F.