subform update?

T

tech.rawsteak

I have a subform that allows a user to enter product orders. I also
have a combo box from which the user can select from a list of vendors
(from a table) and display the vendor's address in a textbox below the
combo box.

if a particular vendor is not on the list, the user may enter a new
vendor by clicking a button and filling out a popup form. upon
closing the add vendor form, focus returns to the order form where the
combo box list is updated and selected to show the new vendor and
their address below.

the problem is when the combo box control on the order form is
requeried to add the new vendor, the entire form is refreshed and i
lose my order form. the entries still exist because they link to the
order form number, but they no longer display on the subform.

currently, after adding the new vendor to its respective table, i
change the RowSourceType of the combobox to "Value List", and then
change it back to "Table/Query" and this seems to repopulate the
combobox with the new vendor without refreshing the vendor form. This
might be more of a "bug" aka "feature" than a solution, so does anyone
else have other possible solutions? I was also considering manually
populating the combobox with a function, and then manually adding an
item to the combobox as needed. would that be slower or faster?

comments, ideas?
 
G

Guest

How are you requerying the combobox? or refreshing?

Have you tried DoCmd.Requery in the on close event of the popup form?
Or Me.refresh again in the on close event.

Make sure you have made a back up copy of your database before you try
anything.

hth Mike B
 
T

tech.rawsteak

i forgot to point out that the subform is in datasheet view

and it's not that the combobox doesn't get updated, but if you enter
orders into the subform, and then decide to add a new vendor, upon
requerying or refreshing the combobox, the subform datasheet is wiped
clean but not erased. that is to say,

if the order form number is 12, and you enter widget1 for some cost,
and widget2 for some cost, and then you enter a new vendor to order
your widgets from,

1) the vendorlist combobox is updated either using refresh or requery
2) the vendorlist combobox is automatically set to the new vendor (you
just entered a new vendor, why should you have to search through the
combobox again?)
3) widget1 and widget2 are not shown on the datasheet anymore BUT they
have been recorded in the itemsRequested table.

if you order additional widgets, they will have the same order form
number as widget1 and widget2 and can all be collected afterwards via
the order form number.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top