goto main forms module

  • Thread starter Thread starter AngiW
  • Start date Start date
A

AngiW

I hope I don't make this too confusing...

I have a form that has an Add cmd button. When the user clicks this, it will
open an error form if need be. On that error form there is a command button
Update. Is there a way to jump back to the main form's code to run the update
or do I need to keep the error form open and run it from there (would rather
not). The Update button needs to update controls on the main form so that
would be easier. I know how to jump from module to module but not inside a
form's code. TIA!
 
Update the main form from the popup. The syntax to do this is

Forms!NameOfMainForm!NameOfControl = Whatever value you're wanting here
 
Wayne,
Thanks for the reply and I hope this doesn't make me sound too ungrateful, but
IS there a way to go back to the main form to do it instead of the popup? I
know how to do it the way you showed me, but the = part of that is quite
frankly horrendous. Thanks again!

Angi
 
If you change the Add button's Click procedure from Private to Public, you
can reference it from other places.

HTH
- Turtle
 
AngiW said:
I hope I don't make this too confusing...

I have a form that has an Add cmd button. When the user clicks this, it will
open an error form if need be. On that error form there is a command button
Update. Is there a way to jump back to the main form's code to run the update
or do I need to keep the error form open and run it from there (would rather
not). The Update button needs to update controls on the main form so that
would be easier. I know how to jump from module to module but not inside a
form's code. TIA!

If you open the error form using the acDialog option, then it will act like a
Message Box. Your calling code will pause until the form is either closed or
hidden and then resume on the next line after the one that opened the form.

Is that what you were looking for?
 
As Rick pointed out, open the popup with the acDialog window mode. When
you're done, hide it instead of closing it. This will allow the calling code
to continue running from where the popup was opened. Transfer the values
from the calling code, then close the popup.
 
Back
Top