Run AfterUpdate code on another form

S

Samantha

How can I open Form2 from Form1, select a value for combo box (Combo 2) in
Form2 based on a combo (Combo1) in Form1, and run the AfterUpdate code for
Combo2?
I am able to open Form2 and select a value for Combo2, but can not run the
AfterUpdate code for Combo2.
I tried calling the AfterUpdate sub-routine for Combo2 but without success.

Here's what I have so far.

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "COMPANY RETURN ADDRESS ADD CHANGE"
DoCmd.OpenForm stDocName, , , stLinkCriteria

[Forms]![Form2]![Combo2].Value = [Forms]![Form1]![Form1-subform]![Combo1]

Call Combo2_AfterUpdate

Any help is greatly appreciated. Thank you.
 
6

'69 Camaro

Hi, Samantha.

Try:

Forms(stDocName).Combo2_AfterUpdate


HTH.

Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)

- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.
 
6

'69 Camaro

Sorry. I grabbed the wrong form name where the combo box resides. Instead
try:

Forms("Form2").Combo2_AfterUpdate


HTH.

Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)

- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.


'69 Camaro said:
Hi, Samantha.

Try:

Forms(stDocName).Combo2_AfterUpdate


HTH.

Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)

- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.


Samantha said:
How can I open Form2 from Form1, select a value for combo box (Combo 2) in
Form2 based on a combo (Combo1) in Form1, and run the AfterUpdate code for
Combo2?
I am able to open Form2 and select a value for Combo2, but can not run the
AfterUpdate code for Combo2.
I tried calling the AfterUpdate sub-routine for Combo2 but without success.

Here's what I have so far.

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "COMPANY RETURN ADDRESS ADD CHANGE"
DoCmd.OpenForm stDocName, , , stLinkCriteria

[Forms]![Form2]![Combo2].Value = [Forms]![Form1]![Form1-subform]![Combo1]

Call Combo2_AfterUpdate

Any help is greatly appreciated. Thank you.
 

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