Refresh & Requery on subform(datasheet)

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

Guest

Hi1 I know there are many postings on refresh & requery but I have not made
my program to work.
I have main form & and subforms. Within one subform(datasheet) I have
dropdown field called "Program", if user want to add new program I have
button above the subform called "Add Prog". Once user update the "Add Prog"
user closes that popup form & back to the subform. User click the dropdown
field to see the one just added but it is not showing. I've tried Refresh,
Requery within the subform & within "Add Prog" form itself but no success.
Please help. Thanks!
 
skk said:
Hi1 I know there are many postings on refresh & requery but I have not made
my program to work.
I have main form & and subforms. Within one subform(datasheet) I have
dropdown field called "Program", if user want to add new program I have
button above the subform called "Add Prog". Once user update the "Add Prog"
user closes that popup form & back to the subform. User click the dropdown
field to see the one just added but it is not showing. I've tried Refresh,
Requery within the subform & within "Add Prog" form itself but no success.
Please help. Thanks!

If your 'Add Prog' button is on the main form then you can try adding
me.subform.requery to the end of the 'Add Prog' code. If that doesn't work
try
me.subform.form.control("field to update").requery.

Hope this helps.

Alison
 
Thanks for the reply Alison.
I've tried both lines but didn't work. The 2nd suggestion syntax I believe
is "me.subform.form.control("field to update").requery ("controls" instead
of "control") and also, you can put index # instead of the field name. One
other point, is that when you start to type the syntax
"me.subform.controls(2)" after controls(2), the intellisense .Refresh is not
showing. I'm thinking it may not be the correct syntax???? Will there be
an any other suggestion? I have command button to update the table & once it
is updated I want updated table to reflect the changes in my subform fields.
Thank you in advance.
 
Alison,

My apology, the syntax you suggestion in 2nd line is correct except use the
"controls" instead of "control". I've used the wrong field name once i've
changed the name it worked fine. Thanks again Alison.

Me.fsubProg.Form.Controls("cboProgram").Requery
 
I'm glad you got it fixed.

I believe that 'refresh' is more similar to a screen repaint than data
requery.

Good Luck.
 
Back
Top