G
Guest
Form 1 (record source is a table) has a combo box that that is used to search
for records. The row source for the combo box is a query. If the desired
record is not found, Form 2 (record source is same table as Form 1) opens to
allow entry of the new record. After adding the new record, Form 2 closes
and Form 1 once again becomes the active form. The combo box on Form 1 is set
to requery after the addition of a new record and Form 2 closes.
When Form 1 is first opened, using the combo box to search for a record and
then display the recordset works fine.
After adding a new record and closing Form 2, the record source table
contains the new record and the requery works fine; the new record is added
to the drop down list of the search combo box in the correct alphabetic
order. So far everything seems to be working perfectly.
What doesn't work at this point, however, is that if the newly added record
is selected from the drop down list in the search combo box, the wrong
recordset is displayed. Instead of the correct recordset, record #1 is
displayed. If another record is selected the correct recordset is displayed,
just as when Form 1 was first opened but selecting the new record always
causing record #1 to be displayed. Of course, once Form 1 is closed and then
reopened, selecting the new record from the search combo box works as it
should.
Can anyone tell me how to correct this? I have tried Refresh but either am
using it on the wrong event, using incorrectly or it is the entirely wrong
thing to use.
for records. The row source for the combo box is a query. If the desired
record is not found, Form 2 (record source is same table as Form 1) opens to
allow entry of the new record. After adding the new record, Form 2 closes
and Form 1 once again becomes the active form. The combo box on Form 1 is set
to requery after the addition of a new record and Form 2 closes.
When Form 1 is first opened, using the combo box to search for a record and
then display the recordset works fine.
After adding a new record and closing Form 2, the record source table
contains the new record and the requery works fine; the new record is added
to the drop down list of the search combo box in the correct alphabetic
order. So far everything seems to be working perfectly.
What doesn't work at this point, however, is that if the newly added record
is selected from the drop down list in the search combo box, the wrong
recordset is displayed. Instead of the correct recordset, record #1 is
displayed. If another record is selected the correct recordset is displayed,
just as when Form 1 was first opened but selecting the new record always
causing record #1 to be displayed. Of course, once Form 1 is closed and then
reopened, selecting the new record from the search combo box works as it
should.
Can anyone tell me how to correct this? I have tried Refresh but either am
using it on the wrong event, using incorrectly or it is the entirely wrong
thing to use.