[AccessD] Want to repopulate combo after adding items

Bill Benson bensonforums at gmail.com
Wed Sep 10 11:01:03 CDT 2014


Auto correct changed popup to popular.
On Sep 10, 2014 11:59 AM, "Bill Benson" <bensonforums at gmail.com> wrote:

> Susan, call the main forms combos  re query right after popular adds the
> new species. Optionally (depends on your workflow) u can also set the list
> index (perhaps value for a cbo) to the just added item as well. I usually
> loop forms to make sure that main form is still open, since sometimes
> species are being added as standalone.
>
> This is one of the things I like about access, that a pop up still can get
> a handle on the previous form.
>
> You can even loop all forms looking for all controls that use species in
> their rowsource, and requery them all at the same time (possibly setting to
> their previous values after re query if that happens to deselect user
> selections ... I can't remember if requery does so). Probably wouldn't hurt
> to prompt the user after the popup, on close, if more than one species were
> added or change, versus only 1, before changing control values. If only 1,
> they probably were adding as a part of the other forms workflow. If they
> added 2 or more, you wouldn't know for sure they wanted to alter the item
> showing in the other control, you only know they wanted to increase the
> population.
> On Sep 10, 2014 11:49 AM, "Susan Harkins" <ssharkins at gmail.com> wrote:
>
>> Setup -- I'm using a combo box to offer current species so the user can
>> just select one instead of re-entering. If the species isn't available
>> yet,
>> there's a command button the user can click to enter the new species.
>>
>> The combo box is populated by a species lookup table.
>>
>> Using the combo box's Click event, I tried to requery the list as follows:
>>
>> Private Sub SpeciesIDFK_Click()
>>     'Repopulate species combo after adding new species.
>>     Me.Requery
>> End Sub
>>
>> The popup form is entering the new species -- I've checked the underlying
>> table and it's there. But, when I return to the main form and click the
>> comb box's dropdown arrow to review the list again, the new species is not
>> in the list.
>>
>> I dropped in a Debug.Print after the Requery method to at least let me
>> know
>> the event is firing and apparently it isn't.
>>
>> I went looking for a dropdown event and while there's lots about what it
>> is, there is not a dropdown event in the Events dropdown in the VBE for
>> the
>> combo box control in question.
>>
>> Any help?
>>
>> Susan H.
>> --
>> AccessD mailing list
>> AccessD at databaseadvisors.com
>> http://databaseadvisors.com/mailman/listinfo/accessd
>> Website: http://www.databaseadvisors.com
>>
>


More information about the AccessD mailing list