Update combobox "on the fly"

  • Thread starter Thread starter Ed Robichaud
  • Start date Start date
E

Ed Robichaud

I have a small donation tracking database with a tblDonors and a related
tblDonations. Among other display/edit forms, it has a data entry type form
to facilitate batch entry of donations. That form has a combobox for
selecting the [DonorID] (a required field in the donation record). That
combobox is set "limited to list" and there is a procedure on the
double-click event to display a form to add a new Donor record. The intent
was to allow users to add new donors "on the fly" than be able to continue
to post the donation. The frmAddNewDonor has code on "after update" and "on
close" events to check if the frmAddNew Donation is open and if so, to
requery the combobox. However, when the frmAddNew Donor closes and the
frmAddNewDonation is active, the cursor is still in the original combobox
(OK so far) but a debug error msg occurs, saying "Must save field before
running Requery". I must be missing something here, any ideas?
-Ed
 
If the LimitToList is set to True, then use the NotInList
event to capture the added record and then open the form.
Then, set the Response=acDataErrAdded


Chris Nebinger
 
Thanks; that's exactly the solution I finally figured out.
-Ed

Chris Nebinger said:
If the LimitToList is set to True, then use the NotInList
event to capture the added record and then open the form.
Then, set the Response=acDataErrAdded


Chris Nebinger
-----Original Message-----
I have a small donation tracking database with a tblDonors and a related
tblDonations. Among other display/edit forms, it has a data entry type form
to facilitate batch entry of donations. That form has a combobox for
selecting the [DonorID] (a required field in the donation record). That
combobox is set "limited to list" and there is a procedure on the
double-click event to display a form to add a new Donor record. The intent
was to allow users to add new donors "on the fly" than be able to continue
to post the donation. The frmAddNewDonor has code on "after update" and "on
close" events to check if the frmAddNew Donation is open and if so, to
requery the combobox. However, when the frmAddNew Donor closes and the
frmAddNewDonation is active, the cursor is still in the original combobox
(OK so far) but a debug error msg occurs, saying "Must save field before
running Requery". I must be missing something here, any ideas?
-Ed


.
 
Back
Top