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

Requery Subform

P: n/a
I have a form that the user enters some information on and then clicks a
button to save the record. I do with the following line:

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

Once this line executes, I have a sub form that I want to "refresh" because
the newly saved information should now display on the sub form. I am trying
to do this with this line:

Forms![sub-frmRegistered_Bidders].Requery

Nut I get and error message telling me that Access can not find the form
"sub-frmRegistered_Bidders".

So my question is this, how do I refresh the sub form after the information
is stored?

Thanks,

Mike
Nov 15 '06 #1
Share this Question
Share on Google+
7 Replies


P: n/a
Subforms are not open in their own right, so they are not part of the Forms
collection.

You need:
Forms![NameOfYourMainFormHere].[sub-frmRegistered_Bidders].Form.Requery

Explanation:
Referring to Controls on a Subform
at:
http://allenbrowne.com/casu-04.html

Other suggestions
=============
a) If the above doesn't work, the Name of the subform control could be
different than the name of the form loaded into it (its Source Object.)

b) You may find it easier to save the form with:
RunCommand acCmdSaveRecord
or even:
If Me.Dirty Then Me.Dirty = False

c) If you have a main form and subform both bound to the same table, and the
table has an AutoNumber primary key, watch out for this bug:
Fixing AutoNumbers when Access assigns negatives or duplicates
at:
http://allenbrowne.com/ser-40.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Reply to group, rather than allenbrowne at mvps dot org.

"SBC News Groups" <me@you.netwrote in message
news:7G*******************@newssvr21.news.prodigy. com...
>I have a form that the user enters some information on and then clicks a
button to save the record. I do with the following line:

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

Once this line executes, I have a sub form that I want to "refresh"
because the newly saved information should now display on the sub form. I
am trying to do this with this line:

Forms![sub-frmRegistered_Bidders].Requery

Nut I get and error message telling me that Access can not find the form
"sub-frmRegistered_Bidders".

So my question is this, how do I refresh the sub form after the
information is stored?

Nov 15 '06 #2

P: n/a
Thansk for the replay Allen, but I still can not get it to work. I modified
my line to the following:

Forms![frmBidders].[sub-frmRegistered_Bidders].Form.Requery

With a period between the [frmBidders] and [sub-frmRegistered_Bidders] I get
an error saying Access can't find the field "|" referred to in your
expression.

If I cahnge the the . to a ! I receive a run-time error 2465, Access can't
find the field 'sub-frmRegistered_Bidders' referred to in your expression.

I dont understand your other suggestions a or b and the form and sub form
are not bound to the same table. The sub form is bound to a query and the
form is bound to a table.

What I am doing wrong? Can you help me?

Mike
"Allen Browne" <Al*********@SeeSig.invalidwrote in message
news:45***********************@per-qv1-newsreader-01.iinet.net.au...
Subforms are not open in their own right, so they are not part of the
Forms collection.

You need:
Forms![NameOfYourMainFormHere].[sub-frmRegistered_Bidders].Form.Requery

Explanation:
Referring to Controls on a Subform
at:
http://allenbrowne.com/casu-04.html

Other suggestions
=============
a) If the above doesn't work, the Name of the subform control could be
different than the name of the form loaded into it (its Source Object.)

b) You may find it easier to save the form with:
RunCommand acCmdSaveRecord
or even:
If Me.Dirty Then Me.Dirty = False

c) If you have a main form and subform both bound to the same table, and
the table has an AutoNumber primary key, watch out for this bug:
Fixing AutoNumbers when Access assigns negatives or duplicates
at:
http://allenbrowne.com/ser-40.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Reply to group, rather than allenbrowne at mvps dot org.

"SBC News Groups" <me@you.netwrote in message
news:7G*******************@newssvr21.news.prodigy. com...
>>I have a form that the user enters some information on and then clicks a
button to save the record. I do with the following line:

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

Once this line executes, I have a sub form that I want to "refresh"
because the newly saved information should now display on the sub form. I
am trying to do this with this line:

Forms![sub-frmRegistered_Bidders].Requery

Nut I get and error message telling me that Access can not find the form
"sub-frmRegistered_Bidders".

So my question is this, how do I refresh the sub form after the
information is stored?


Nov 16 '06 #3

P: n/a
If the subform has a module, or has the HasModule property set to true
then

Form_sub-frmRegistered_Bidder.Requery

should do the trick.

On Nov 14, 11:26 pm, "SBC News Groups" <m...@you.netwrote:
I have a form that the user enters some information on and then clicks a
button to save the record. I do with the following line:

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

Once this line executes, I have a sub form that I want to "refresh" because
the newly saved information should now display on the sub form. I am trying
to do this with this line:

Forms![sub-frmRegistered_Bidders].Requery

Nut I get and error message telling me that Access can not find the form
"sub-frmRegistered_Bidders".

So my question is this, how do I refresh the sub form after the information
is stored?

Thanks,

Mike
Nov 16 '06 #4

P: n/a
The Has Module property is set to No.

Any other ideas?

Mike

"Lyle Fairfield" <ly***********@aim.comwrote in message
news:11*********************@h48g2000cwc.googlegro ups.com...
If the subform has a module, or has the HasModule property set to true
then

Form_sub-frmRegistered_Bidder.Requery

should do the trick.

On Nov 14, 11:26 pm, "SBC News Groups" <m...@you.netwrote:
>I have a form that the user enters some information on and then clicks a
button to save the record. I do with the following line:

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

Once this line executes, I have a sub form that I want to "refresh"
because
the newly saved information should now display on the sub form. I am
trying
to do this with this line:

Forms![sub-frmRegistered_Bidders].Requery

Nut I get and error message telling me that Access can not find the form
"sub-frmRegistered_Bidders".

So my question is this, how do I refresh the sub form after the
information
is stored?

Thanks,

Mike

Nov 16 '06 #5

P: n/a
Open the main form in design view.

Right-click the edge of the subform control, and choose Properties.

What is the Name property of the subform control?
(It's the first item on the Other tab of the Properties box.)

The Name of the subform control may not be sub-frmRegistered_Bidders, even
if that is the name of the form that gets loaded into the 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.

"SBC News Groups" <me@you.netwrote in message
news:rr****************@newssvr14.news.prodigy.com ...
Thansk for the replay Allen, but I still can not get it to work. I
modified my line to the following:

Forms![frmBidders].[sub-frmRegistered_Bidders].Form.Requery

With a period between the [frmBidders] and [sub-frmRegistered_Bidders] I
get an error saying Access can't find the field "|" referred to in your
expression.

If I cahnge the the . to a ! I receive a run-time error 2465, Access can't
find the field 'sub-frmRegistered_Bidders' referred to in your expression.

I dont understand your other suggestions a or b and the form and sub form
are not bound to the same table. The sub form is bound to a query and the
form is bound to a table.

What I am doing wrong? Can you help me?

Mike
"Allen Browne" <Al*********@SeeSig.invalidwrote in message
news:45***********************@per-qv1-newsreader-01.iinet.net.au...
>Subforms are not open in their own right, so they are not part of the
Forms collection.

You need:

Forms![NameOfYourMainFormHere].[sub-frmRegistered_Bidders].Form.Requery

Explanation:
Referring to Controls on a Subform
at:
http://allenbrowne.com/casu-04.html

Other suggestions
=============
a) If the above doesn't work, the Name of the subform control could be
different than the name of the form loaded into it (its Source Object.)

b) You may find it easier to save the form with:
RunCommand acCmdSaveRecord
or even:
If Me.Dirty Then Me.Dirty = False

c) If you have a main form and subform both bound to the same table, and
the table has an AutoNumber primary key, watch out for this bug:
Fixing AutoNumbers when Access assigns negatives or duplicates
at:
http://allenbrowne.com/ser-40.html

"SBC News Groups" <me@you.netwrote in message
news:7G*******************@newssvr21.news.prodigy .com...
>>>I have a form that the user enters some information on and then clicks a
button to save the record. I do with the following line:

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

Once this line executes, I have a sub form that I want to "refresh"
because the newly saved information should now display on the sub form.
I am trying to do this with this line:

Forms![sub-frmRegistered_Bidders].Requery

Nut I get and error message telling me that Access can not find the form
"sub-frmRegistered_Bidders".

So my question is this, how do I refresh the sub form after the
information is stored?

Nov 16 '06 #6

P: n/a
On Thu, 16 Nov 2006 03:46:25 GMT, "SBC News Groups" <me@you.netwrote:

Set it to Yes.
>The Has Module property is set to No.

Any other ideas?

Mike

"Lyle Fairfield" <ly***********@aim.comwrote in message
news:11*********************@h48g2000cwc.googlegr oups.com...
>If the subform has a module, or has the HasModule property set to true
then

Form_sub-frmRegistered_Bidder.Requery

should do the trick.

On Nov 14, 11:26 pm, "SBC News Groups" <m...@you.netwrote:
>>I have a form that the user enters some information on and then clicks a
button to save the record. I do with the following line:

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

Once this line executes, I have a sub form that I want to "refresh"
because
the newly saved information should now display on the sub form. I am
trying
to do this with this line:

Forms![sub-frmRegistered_Bidders].Requery

Nut I get and error message telling me that Access can not find the form
"sub-frmRegistered_Bidders".

So my question is this, how do I refresh the sub form after the
information
is stored?

Thanks,

Mike
Wayne Gillespie
Gosford NSW Australia
Nov 16 '06 #7

P: n/a
Thanks a bunch!!

The name was actually qryRegistered_Bidders not sub-frmRegistered_Bidders.

It works now.

Mike

"Allen Browne" <Al*********@SeeSig.invalidwrote in message
news:45***********************@per-qv1-newsreader-01.iinet.net.au...
Open the main form in design view.

Right-click the edge of the subform control, and choose Properties.

What is the Name property of the subform control?
(It's the first item on the Other tab of the Properties box.)

The Name of the subform control may not be sub-frmRegistered_Bidders, even
if that is the name of the form that gets loaded into the 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.

"SBC News Groups" <me@you.netwrote in message
news:rr****************@newssvr14.news.prodigy.com ...
>Thansk for the replay Allen, but I still can not get it to work. I
modified my line to the following:

Forms![frmBidders].[sub-frmRegistered_Bidders].Form.Requery

With a period between the [frmBidders] and [sub-frmRegistered_Bidders] I
get an error saying Access can't find the field "|" referred to in your
expression.

If I cahnge the the . to a ! I receive a run-time error 2465, Access
can't find the field 'sub-frmRegistered_Bidders' referred to in your
expression.

I dont understand your other suggestions a or b and the form and sub form
are not bound to the same table. The sub form is bound to a query and the
form is bound to a table.

What I am doing wrong? Can you help me?

Mike
"Allen Browne" <Al*********@SeeSig.invalidwrote in message
news:45***********************@per-qv1-newsreader-01.iinet.net.au...
>>Subforms are not open in their own right, so they are not part of the
Forms collection.

You need:

Forms![NameOfYourMainFormHere].[sub-frmRegistered_Bidders].Form.Requery

Explanation:
Referring to Controls on a Subform
at:
http://allenbrowne.com/casu-04.html

Other suggestions
=============
a) If the above doesn't work, the Name of the subform control could be
different than the name of the form loaded into it (its Source Object.)

b) You may find it easier to save the form with:
RunCommand acCmdSaveRecord
or even:
If Me.Dirty Then Me.Dirty = False

c) If you have a main form and subform both bound to the same table, and
the table has an AutoNumber primary key, watch out for this bug:
Fixing AutoNumbers when Access assigns negatives or duplicates
at:
http://allenbrowne.com/ser-40.html

"SBC News Groups" <me@you.netwrote in message
news:7G*******************@newssvr21.news.prodig y.com...
I have a form that the user enters some information on and then clicks a
button to save the record. I do with the following line:

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

Once this line executes, I have a sub form that I want to "refresh"
because the newly saved information should now display on the sub form.
I am trying to do this with this line:

Forms![sub-frmRegistered_Bidders].Requery

Nut I get and error message telling me that Access can not find the
form "sub-frmRegistered_Bidders".

So my question is this, how do I refresh the sub form after the
information is stored?


Nov 16 '06 #8

This discussion thread is closed

Replies have been disabled for this discussion.