Subform to requery Main form field

naobao

Registered User.
Local time
Today, 10:07
Joined
Feb 13, 2014
Messages
99
Hi,


How to requery "B"after entry a new record in "A"
 

Attachments

  • 123.jpg
    123.jpg
    53.5 KB · Views: 107
Hi. It's not obvious from the image, but is form B unbound?
 
"A" field is in subform, "B" field is in main form
 
"A" field is in subform, "B" field is in main form
That didn't really answer my question; but if it's a true form/subform setup, did you have the correct fields in the Master/Child Linked Fields properties? If not, then I guess what you're asking is how to refresh the data. If so, you could try using the Requery command, maybe in the AfterUpdate event of the textbox on the main form.
 
it not work use in subform field AfterUpdate event...
 
it not work use in subform field AfterUpdate event...
Hi. Sorry to hear that. Unfortunately, I can't tell you why or what else to try since I have no idea what your database really looks like. You didn't tell us if the form is bound or if the subform is properly linked to the main form. I'm not even sure if you're expecting to see the data you entered on the main form to show up in the subform. Are you able to post a sample db?
 
Hi theDBguy

Please check the attached file
Hi. I downloaded your sample file, but I'm getting an error because I don't have the same language pack installed as you. In any case, try using Me.Recalc in the button code instead of Me.Requery. Hope it helps...
 
Me.Recalc same no use!

I just only want to know, after update the subfom field, how to requery the main form field?
 
Me.Recalc same no use!

I just only want to know, after update the subfom field, how to requery the main form field?
Hi. To requery, you use Requery. To recalculate, you use Recalc. In the demo you posted for me, you don't have anything on the main form. They are all subforms. The two smaller subforms are read only, so I imagine you want to update those because you can only update the bigger subform. I created a test file and tried using Recalc, and it worked for me. Since I can't really use your demo file, I can't test it.
 
please check the pic
 

Attachments

  • 111.jpg
    111.jpg
    68.5 KB · Views: 90
Sorry to make you confused...
I mean not use the button,
is the big subform field after update,
the two small subform can auto requery
 
Sorry to make you confused...
I mean not use the button,
is the big subform field after update,
the two small subform can auto requery
Hi. Either way, I still used Recalc. Check out the attached modified demo. You don't have to click the button, although I left it there.
 

Attachments

Users who are viewing this thread

Back
Top Bottom