pass value back to subform on close

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a main form with a subform in table view. I have a query based form
to search for items to go into the table. When this query based form opens
you enter the search critera and then can click through the results. I would
like to place a button on the search form to close it and pass the key value
back to the subform on the main form.

main form w/subform -->search for items using a new form -->return key
values back to original subform

Thanks in advance for your help.
 
One approach: the main form closes all forms it opens:

Open Search form from Main
(main form enters "WaitUntilFormInvisible(SearchForm)" loop)
(search on search form)
"close" button on search form only turns it invisible, doesn't close it
(main form exits "WaitUntilFormInvisible(SearchForm)" loop)
Main form grabs value from search form
Main form closes search form
 
I have a main form with a subform in table view. I have a query based form
to search for items to go into the table. When this query based form opens
you enter the search critera and then can click through the results. I would
like to place a button on the search form to close it and pass the key value
back to the subform on the main form.

main form w/subform -->search for items using a new form -->return key
values back to original subform

Thanks in advance for your help.

in the close event of your search form:

Forms("MainForm").SubFormControl.form.TxtControl=MyValueWhatIWantThere

This will write the MyValueWhatIWantThere into a txtControl into the
subform on the mainform
 
Forms("MainForm").SubFormControl.form.TxtControl=MyValueWhatIWantThere
in my code I have:

"mainformname"."subformname".form."txtcontrolname"="currentformname.txtcontrolname"

I'm getting the error: "Missing Object"

Thanks,
 
in my code I have:

"mainformname"."subformname".form."txtcontrolname"="currentformname.txtcontrolname"

I'm getting the error: "Missing Object"

Thanks,

I miss the first Forms
the name of the mainform has to be a string, the rest is without
strings

the form that is "currentformname" is Me or if you like to type:
Forms("currentformname").txtcontrolname

SubFormname is not subformControl (if you work with assistents then
its the same)

in other words:
Forms("mainformname").subformControl.form.txtcontrolname=me.txtcontrolname
 
Back
Top