A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Requery a subform from another subform



 
 
Thread Tools Display Modes
  #1  
Old May 2nd, 2005, 02:15 AM
Debbie
external usenet poster
 
Posts: n/a
Default Requery a subform from another subform

Hello,
I have a main form (MainForm1). It contains 2
seperate subforms on it totally independent of one another (subform1) and
(subform2). Subform1 contains a list of selectable rows. Once the user
selects a row from subform1, they click on a button that adds it to the
underlying table on subform2. I would like the new rows to be displayed on
subform2. I have put the following statement in the button on subform1
where the user selects the row and I have put it in the AfterUpdate event on
subform1:
Forms!Mainform1!subform2.form.Requery

I've also used:
Forms!Mainform1!subform2.Requery

Still no requerying is happening. Can this be done and if so, what am I
doing wrong. I truly appreciate any input. Thanks,
Debbie
  #2  
Old May 2nd, 2005, 02:33 AM
Arvin Meyer
external usenet poster
 
Posts: n/a
Default

Hi Debbie,

The first syntax:

Forms!Mainform1!subform2.form.Requery

is correct. It could be that the AfterUpdate of the form hasn't fired yet.
Stick a line below the requery line like:

MsgBox "Yep, I've fired"

and see if it pops up. You can also force a requery with a "bigger hammer"
just do something like:

Forms!Mainform1!subform2.form.Recordsource = "Select whatever ..."

and give it the same recordsource as the first one. Access will think you're
changing the recordsource and force a requery.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access

"Debbie" wrote in message
...
Hello,
I have a main form (MainForm1). It contains 2
seperate subforms on it totally independent of one another (subform1) and
(subform2). Subform1 contains a list of selectable rows. Once the user
selects a row from subform1, they click on a button that adds it to the
underlying table on subform2. I would like the new rows to be displayed on
subform2. I have put the following statement in the button on subform1
where the user selects the row and I have put it in the AfterUpdate event

on
subform1:
Forms!Mainform1!subform2.form.Requery

I've also used:
Forms!Mainform1!subform2.Requery

Still no requerying is happening. Can this be done and if so, what am I
doing wrong. I truly appreciate any input. Thanks,
Debbie



  #3  
Old May 2nd, 2005, 10:21 PM
Debbie
external usenet poster
 
Posts: n/a
Default

Arvin,
Thanks so much for your reply. I did try that and I got a message saying
"...can't find subform2..." Something then hit me that I never thought would
matter and that is that these subforms are within a tab control. Do I need
to reference the tab control and then the subform? I'm sorry I didn't
mention it earlier but I did not think it would make a difference. Thanks,
Debbie

"Arvin Meyer" wrote:

Hi Debbie,

The first syntax:

Forms!Mainform1!subform2.form.Requery

is correct. It could be that the AfterUpdate of the form hasn't fired yet.
Stick a line below the requery line like:

MsgBox "Yep, I've fired"

and see if it pops up. You can also force a requery with a "bigger hammer"
just do something like:

Forms!Mainform1!subform2.form.Recordsource = "Select whatever ..."

and give it the same recordsource as the first one. Access will think you're
changing the recordsource and force a requery.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access

"Debbie" wrote in message
...
Hello,
I have a main form (MainForm1). It contains 2
seperate subforms on it totally independent of one another (subform1) and
(subform2). Subform1 contains a list of selectable rows. Once the user
selects a row from subform1, they click on a button that adds it to the
underlying table on subform2. I would like the new rows to be displayed on
subform2. I have put the following statement in the button on subform1
where the user selects the row and I have put it in the AfterUpdate event

on
subform1:
Forms!Mainform1!subform2.form.Requery

I've also used:
Forms!Mainform1!subform2.Requery

Still no requerying is happening. Can this be done and if so, what am I
doing wrong. I truly appreciate any input. Thanks,
Debbie




  #4  
Old May 3rd, 2005, 07:09 PM
Arvin Meyer
external usenet poster
 
Posts: n/a
Default

No the Tab control makes no difference in syntax, but it's possible that
"subform2" has a different name.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access Downloads
http://www.datastrat.com
http://www.mvps.org/access

"Debbie" wrote in message
...
Arvin,
Thanks so much for your reply. I did try that and I got a message saying
"...can't find subform2..." Something then hit me that I never thought

would
matter and that is that these subforms are within a tab control. Do I

need
to reference the tab control and then the subform? I'm sorry I didn't
mention it earlier but I did not think it would make a difference.

Thanks,
Debbie

"Arvin Meyer" wrote:

Hi Debbie,

The first syntax:

Forms!Mainform1!subform2.form.Requery

is correct. It could be that the AfterUpdate of the form hasn't fired

yet.
Stick a line below the requery line like:

MsgBox "Yep, I've fired"

and see if it pops up. You can also force a requery with a "bigger

hammer"
just do something like:

Forms!Mainform1!subform2.form.Recordsource = "Select whatever ..."

and give it the same recordsource as the first one. Access will think

you're
changing the recordsource and force a requery.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access

"Debbie" wrote in message
...
Hello,
I have a main form (MainForm1). It contains 2
seperate subforms on it totally independent of one another (subform1)

and
(subform2). Subform1 contains a list of selectable rows. Once the user
selects a row from subform1, they click on a button that adds it to

the
underlying table on subform2. I would like the new rows to be

displayed on
subform2. I have put the following statement in the button on subform1
where the user selects the row and I have put it in the AfterUpdate

event
on
subform1:
Forms!Mainform1!subform2.form.Requery

I've also used:
Forms!Mainform1!subform2.Requery

Still no requerying is happening. Can this be done and if so, what am

I
doing wrong. I truly appreciate any input. Thanks,
Debbie






  #5  
Old May 4th, 2005, 03:14 AM
Debbie
external usenet poster
 
Posts: n/a
Default

Arvin,
Thank you again. I did get the syntax right but it is still not requerying.
I am going to do something different as I think the requerying is being done
but the inserted row is not available immediately. Even if I press F9, the
row doesn't always show on the first time pressing F9. A new problem to
research! Thanks again for your help.
Debbie

"Arvin Meyer" wrote:

No the Tab control makes no difference in syntax, but it's possible that
"subform2" has a different name.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access Downloads
http://www.datastrat.com
http://www.mvps.org/access

"Debbie" wrote in message
...
Arvin,
Thanks so much for your reply. I did try that and I got a message saying
"...can't find subform2..." Something then hit me that I never thought

would
matter and that is that these subforms are within a tab control. Do I

need
to reference the tab control and then the subform? I'm sorry I didn't
mention it earlier but I did not think it would make a difference.

Thanks,
Debbie

"Arvin Meyer" wrote:

Hi Debbie,

The first syntax:

Forms!Mainform1!subform2.form.Requery

is correct. It could be that the AfterUpdate of the form hasn't fired

yet.
Stick a line below the requery line like:

MsgBox "Yep, I've fired"

and see if it pops up. You can also force a requery with a "bigger

hammer"
just do something like:

Forms!Mainform1!subform2.form.Recordsource = "Select whatever ..."

and give it the same recordsource as the first one. Access will think

you're
changing the recordsource and force a requery.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access

"Debbie" wrote in message
...
Hello,
I have a main form (MainForm1). It contains 2
seperate subforms on it totally independent of one another (subform1)

and
(subform2). Subform1 contains a list of selectable rows. Once the user
selects a row from subform1, they click on a button that adds it to

the
underlying table on subform2. I would like the new rows to be

displayed on
subform2. I have put the following statement in the button on subform1
where the user selects the row and I have put it in the AfterUpdate

event
on
subform1:
Forms!Mainform1!subform2.form.Requery

I've also used:
Forms!Mainform1!subform2.Requery

Still no requerying is happening. Can this be done and if so, what am

I
doing wrong. I truly appreciate any input. Thanks,
Debbie






 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
requery tabs subform data if other tabs subform changes Chris General Discussion 1 April 20th, 2005 08:34 AM
Requery in a SubForm Marc Using Forms 1 March 18th, 2005 08:43 PM
Requery in a SubForm Marc Running & Setting Up Queries 1 March 18th, 2005 08:43 PM
Subform Refresh Problem (but only with an unbound combo box control) Barry Skidmore Using Forms 1 December 21st, 2004 01:19 AM


All times are GMT +1. The time now is 09:56 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.