R
Reggie Laffond
My application starts on a continuous form that lists names of people who
need to be called. Its control source is a query that selects only records
where the yes/no field named "complete" is valued No. When a record is
selected (by clicking a command button on the desired row) a single record
form is opened displaying only the record selected on the continuous form
and the continuous form is closed in code. After the user finishes the call
the user clicks a command button on the single form indicating that the call
has been made. In code I open a recordset, seek the record being displayed,
edit the recordset, set the yes/no field "complete" to Yes and update the
recordset. Then I close the recordset object, close the database object,
close the single form and open the continuous form.
Set db = CurrentDB
Set rs = db.OpenRecordset("tblAll", dbOpenTable)
rs.Index = "PrimaryKey"
rs.Seek "=", Me.txtAccount
If Not rs.NoMatch Then
rs.Edit
rs.Fields("Complete") = True
rs.Update
End If
rs.Close
db.Close
DoCmd.Close , "frmSingleRecord"
DoCmd.OpenForm "frmListRecords"
When "frmListRecords" opens, the record that I just updated the "complete"
field to Yes is displayed but shouldn't because the query that feeds it has,
as part of its criteria, that "complete" must be No. If I close the
continuous form and open it 2 seconds later the record in question does not
display (and it should not).
It almost seems that after the single form updates the "complete" field to
Yes, the continuous form opens too quickly before the update is actually
finished.
Is that possible? Is there a way I can wait until the update is finished
before opening my continuous for?
Thanks in advance.
need to be called. Its control source is a query that selects only records
where the yes/no field named "complete" is valued No. When a record is
selected (by clicking a command button on the desired row) a single record
form is opened displaying only the record selected on the continuous form
and the continuous form is closed in code. After the user finishes the call
the user clicks a command button on the single form indicating that the call
has been made. In code I open a recordset, seek the record being displayed,
edit the recordset, set the yes/no field "complete" to Yes and update the
recordset. Then I close the recordset object, close the database object,
close the single form and open the continuous form.
Set db = CurrentDB
Set rs = db.OpenRecordset("tblAll", dbOpenTable)
rs.Index = "PrimaryKey"
rs.Seek "=", Me.txtAccount
If Not rs.NoMatch Then
rs.Edit
rs.Fields("Complete") = True
rs.Update
End If
rs.Close
db.Close
DoCmd.Close , "frmSingleRecord"
DoCmd.OpenForm "frmListRecords"
When "frmListRecords" opens, the record that I just updated the "complete"
field to Yes is displayed but shouldn't because the query that feeds it has,
as part of its criteria, that "complete" must be No. If I close the
continuous form and open it 2 seconds later the record in question does not
display (and it should not).
It almost seems that after the single form updates the "complete" field to
Yes, the continuous form opens too quickly before the update is actually
finished.
Is that possible? Is there a way I can wait until the update is finished
before opening my continuous for?
Thanks in advance.