G
Guest
I have added code to a form to trap a "item not found" error on a combo box
and call a dialog box allowing the user to either cancel the edit, or to add
a record to the combo box source table (query). Code on the entry form for
the lookup table attempts (after saving the new record) to requery the
updated combo box source on the first form:
dim lkup as control
set lkup as forms!Form1!cbLkUp
lkup.requery
When run, I get the message "must save this field.." Of course, Form1 is
also open and the error causing entry is still in the combobox which has
focus on that form. What I want is for the combo box datasouce query to
update so that the keyed data (in the combo box) will not cause and error and
will pull in the new linked data fields. How do I do that without closing
and then reopening the form?
I should add that the source of the first form is a query on a transaction
table and the master 'names' table containing the source field for the combo
box. Perhaps I should requery the form source as well?
DM
and call a dialog box allowing the user to either cancel the edit, or to add
a record to the combo box source table (query). Code on the entry form for
the lookup table attempts (after saving the new record) to requery the
updated combo box source on the first form:
dim lkup as control
set lkup as forms!Form1!cbLkUp
lkup.requery
When run, I get the message "must save this field.." Of course, Form1 is
also open and the error causing entry is still in the combobox which has
focus on that form. What I want is for the combo box datasouce query to
update so that the keyed data (in the combo box) will not cause and error and
will pull in the new linked data fields. How do I do that without closing
and then reopening the form?
I should add that the source of the first form is a query on a transaction
table and the master 'names' table containing the source field for the combo
box. Perhaps I should requery the form source as well?
DM