Requery the subform

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

Guest

Hi, everybody,

I have created a "Master" form with a "Detail" subform. In the subform, I
have an [Add New] botton that will open the "INPUT" form to add new record as
some of the reference field is not available in the "Detail" subform. There
is a [Add] botton on the "INPUT" form to add the record to the table and
close the form.

I try a couple way but I cannot refresh the information on "Detail' subform,
any suggestion or method I should use? As there are forms open and close,
can I write the get focus or lose focus event?

Thank you very much for your kind advice.

Regards,

BL
 
on your AddNew click event, after you call the subform,
enter

Forms!YourMainform.yoursubform.Requery

Damon
 
i meant after u call your Input form...

Damon

Damon Heron said:
on your AddNew click event, after you call the subform,
enter

Forms!YourMainform.yoursubform.Requery

Damon

BL said:
Hi, everybody,

I have created a "Master" form with a "Detail" subform. In the subform,
I
have an [Add New] botton that will open the "INPUT" form to add new
record as
some of the reference field is not available in the "Detail" subform.
There
is a [Add] botton on the "INPUT" form to add the record to the table and
close the form.

I try a couple way but I cannot refresh the information on "Detail'
subform,
any suggestion or method I should use? As there are forms open and
close,
can I write the get focus or lose focus event?

Thank you very much for your kind advice.

Regards,

BL
 
Hi, Damon,

Thank you very much for your response. I try the code but I have an error
saying that Access cannot find the form "yoursubform" in a macro expression
or Visual Basic Code. I try to create a simple form without a subform and
use the same code [Forms![Simple_Form].requery, and I got the same error.

Can you help me for that? Moreover, if I use more than one form in the
process, how does Access behave when executing code in different form module?
Thanks again for your time.

Regards,

BL

Damon Heron said:
i meant after u call your Input form...

Damon

Damon Heron said:
on your AddNew click event, after you call the subform,
enter

Forms!YourMainform.yoursubform.Requery

Damon

BL said:
Hi, everybody,

I have created a "Master" form with a "Detail" subform. In the subform,
I
have an [Add New] botton that will open the "INPUT" form to add new
record as
some of the reference field is not available in the "Detail" subform.
There
is a [Add] botton on the "INPUT" form to add the record to the table and
close the form.

I try a couple way but I cannot refresh the information on "Detail'
subform,
any suggestion or method I should use? As there are forms open and
close,
can I write the get focus or lose focus event?

Thank you very much for your kind advice.

Regards,

BL
 
You have to substitute the name of your two forms. that is a generic
example.

Damon



BL said:
Hi, Damon,

Thank you very much for your response. I try the code but I have an error
saying that Access cannot find the form "yoursubform" in a macro
expression
or Visual Basic Code. I try to create a simple form without a subform and
use the same code [Forms![Simple_Form].requery, and I got the same error.

Can you help me for that? Moreover, if I use more than one form in the
process, how does Access behave when executing code in different form
module?
Thanks again for your time.

Regards,

BL

Damon Heron said:
i meant after u call your Input form...

Damon

Damon Heron said:
on your AddNew click event, after you call the subform,
enter

Forms!YourMainform.yoursubform.Requery

Damon

Hi, everybody,

I have created a "Master" form with a "Detail" subform. In the
subform,
I
have an [Add New] botton that will open the "INPUT" form to add new
record as
some of the reference field is not available in the "Detail" subform.
There
is a [Add] botton on the "INPUT" form to add the record to the table
and
close the form.

I try a couple way but I cannot refresh the information on "Detail'
subform,
any suggestion or method I should use? As there are forms open and
close,
can I write the get focus or lose focus event?

Thank you very much for your kind advice.

Regards,

BL
 
Back
Top