when subform updated, want linked field to simultaneously update

G

Guest

Hi.
I've got 2 forms; mainform (this form is not setup as continuous, due to
much larger form design) and eucontact form (this form setup as continuous).
The eucontact form is relational to the mainform eu field, which pulls one
piece of info from the eucontact form (originally setup via the "lookup
wizard" on the table design view). This was setup to keep the user from
needing to re-input eu info each time they fill out the mainform. I have
also setup 2 command buttons; one to "add new" which opens up the eucontact
form and allows the user to add the necessary info, and the 2nd button is to
pull up the matching eu from the eucontact form so that the user can view all
the eucontact information and make any changes if necessary.

Everything's working fine, except I need a simultaneous update whereas the
user adds a new record to the eucontact form, the eu field needs to list the
newly entered data as selectable. Right now, that doesn't happen until both
forms are closed and the mainform is reopened.

What's the code that I need to enter in what propery field (afterupdate, on
enter, etc) for the EU field?

Also, is there a way that when I pull the matching data via the command
button from the subform that it pulls up the form in non-continuous mode (so
that the blank "add" form is not showing as well)?

Thank you very much!

bc
 
G

Guest

Hi. I'm sorry that no one was able to help me with this request. I have
gotten an answer outside of microsoft's forums that I will share with the
group in the event anyone else needs a solution similar to mine.

In the mainform (design view), you need to put the following code in the
command button EVENT tab, in the "On Exit" field. (easiest to click the
"..." and open the code builder to get the "Private Sub" and "End Sub"
markers on the code.

In between "Private Sub" and "End Sub" tab once and put the code:
Forms!formname.Refresh

Change "formname" with the actual form name of the mainform you're working
on (case sensitive, I believe).

bc
 

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