update form when combo updated from another form

C

Cobert

I have a form for users to enter details of sales contracts. Part of that
form is a combo box that allows the user to select a product code. Using the
combo box After Update event details are copied from a 'Products' table to
the contract. They need to be copied to the contract rather than just
linking the data as product details may change on the products table but the
contract must state the original product details.

As there are a lot of products, I thought I would create a search facility.
So now the user can click a button on the contract form which brings up
another form on which the user can type a word or two then another form
opens showing a list of the products containing those words. I pass opening
args down the line so the user can click on the product they want, both
search forms close and the product code is transferred to the combo box on
the contract form. It all works great so far. But now the problem. How do I
get the contract form to show all of the new details of the product. ie what
I want to do is make it run the 'AfterUpdate' event when the user selects
the product on the search form. No event seems to be triggered by the search
form putting the value into the combo box on the contract form.

Anyone have any ideas... thanks

Colin
 
G

Gerald Stanley

In the button's Click eventhandler code, try putting a call
to the combo box's AfterUpdate eventhandler after the
DoCmd.OpenForm line that opens the Search form. This
should work assuming that the Search form is opened as a
modal form.

e.g.

DoCmd.OpenForm 'searchForm'
ProductCombo_AfterUpdate

Hope This Helps
Gerald Stanley MCSD
 
C

Cobert

That doesn't seem to work. I have made the search form modal but the
'AfterUpdate' procedure still tries to run straight away.

Colin

In the button's Click eventhandler code, try putting a call
to the combo box's AfterUpdate eventhandler after the
DoCmd.OpenForm line that opens the Search form. This
should work assuming that the Search form is opened as a
modal form.

e.g.

DoCmd.OpenForm 'searchForm'
ProductCombo_AfterUpdate

Hope This Helps
Gerald Stanley MCSD
 

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