By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,676 Members | 1,636 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,676 IT Pros & Developers. It's quick & easy.

Can't Requery Subform

P: n/a

All:

Form A: Main_Form
Form B: Sub_Form (has the control name: Sub_Form_Control_Name)
Form C: Independent_Form

Form C is based on a table which is also used by Form B.

When Form C is used to update the table I want to requery and redisplay the
data in Form B.

Using the OnClose property of Form C, the following code is inserted:

Forms![Main_Form]![Sub_Form_Control_Name].Requery

The code compiles and runs but even though the table is updated, the data
displayed in Form B remains the same.

Obviously, I would like it to change.

Any thoughts?

TIA,

Steve
Nov 13 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Try:
Forms![Main_Form]![Sub_Form_Control_Name].Form.Requery

Can't promise it will fix it, but that is the difference between requerying
the subform control, and requerying the form in the subform control.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"mooseshoes" <mo********@gmx.net> wrote in message
news:Ut*******************@newssvr29.news.prodigy. com...

All:

Form A: Main_Form
Form B: Sub_Form (has the control name: Sub_Form_Control_Name)
Form C: Independent_Form

Form C is based on a table which is also used by Form B.

When Form C is used to update the table I want to requery and redisplay
the
data in Form B.

Using the OnClose property of Form C, the following code is inserted:

Forms![Main_Form]![Sub_Form_Control_Name].Requery

The code compiles and runs but even though the table is updated, the data
displayed in Form B remains the same.

Obviously, I would like it to change.

Any thoughts?

TIA,

Steve

Nov 13 '05 #2

P: n/a
<snip>
Try:
Forms![Main_Form]![Sub_Form_Control_Name].Form.Requery

Can't promise it will fix it, but that is the difference between
requerying the subform control, and requerying the form in the subform
control.

Results in:
Run-time error '438':

Object doesn't support this property or method
I'm using Access 2K.


Thanks,

Steve
Nov 13 '05 #3

P: n/a
Open your main form in design view.
Right-click the edge of the subform control, and choose Properties.
On the Other tab, what is the Name of the subform control?

The syntax requires you to use the Name of the subform control, which can be
different from its Source Object (the name of the form it contains).

If that does not solve the problem:
1. Does your code compile?

2. Any issues with library references? See:
http://members.iinet.net.au/~allenbrowne/ser-38.html
Which libraries do you have referenced?

3. Have you disabled Name AutoCorrect? See:
http://members.iinet.net.au/~allenbrowne/bug-03.html
After doing this, you need to:
- modify some code in the module (so it becomes uncompiled),
- compact (Tools | Database Utilities | Compact) to get of this stuff;
- compile again.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"mooseshoes" <mo********@gmx.net> wrote in message
news:U8******************@newssvr27.news.prodigy.c om...
<snip>
Try:
Forms![Main_Form]![Sub_Form_Control_Name].Form.Requery

Can't promise it will fix it, but that is the difference between
requerying the subform control, and requerying the form in the subform
control.

Results in:
Run-time error '438':

Object doesn't support this property or method
I'm using Access 2K.


Thanks,

Steve

Nov 13 '05 #4

P: n/a
Yep. I thought I had the subform control name right, but I didn't. I
believe all is well now.

Thank you for your assistance.

Steve
Nov 13 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.