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  

Updating SubForms ! GURU NEEDED!!!!



 
 
Thread Tools Display Modes
  #1  
Old June 27th, 2008, 06:56 PM posted to microsoft.public.access.forms
TheNovice
external usenet poster
 
Posts: 67
Default Updating SubForms ! GURU NEEDED!!!!

Good Day All,
(Yes its me again!!!)

I have a Form with a SubForm, the main Form is from tmpHdrRoutes and the Sub
Form is from the source table.

The header information is what can change (i.e. Route Number, Clock-in etc.)
this info needs to be updated to the subform.

I have tried

me.routes = me.hdrRoutes

and it failed,

tried:

forms!frmSubRoute_SQL![routes] = me.hdrRoutes

and this also failed.



--
-The Novice
Learn Today, Teach Tomorrow

Great Success is ones ability to ask for Help.
  #2  
Old June 27th, 2008, 07:02 PM posted to microsoft.public.access.forms
Jay
external usenet poster
 
Posts: 704
Default Updating SubForms ! GURU NEEDED!!!!

Try somthing like

Me.SubFormName.Controls("SubFormControlName")

to refer to a control on a subform.

"TheNovice" wrote:

Good Day All,
(Yes its me again!!!)

I have a Form with a SubForm, the main Form is from tmpHdrRoutes and the Sub
Form is from the source table.

The header information is what can change (i.e. Route Number, Clock-in etc.)
this info needs to be updated to the subform.

I have tried

me.routes = me.hdrRoutes

and it failed,

tried:

forms!frmSubRoute_SQL![routes] = me.hdrRoutes

and this also failed.



--
-The Novice
Learn Today, Teach Tomorrow

Great Success is ones ability to ask for Help.

  #3  
Old June 27th, 2008, 07:29 PM posted to microsoft.public.access.forms
Beetle
external usenet poster
 
Posts: 1,254
Default Updating SubForms ! GURU NEEDED!!!!

To refer to a control on a subform, the syntax is;

Me!SubformControlName.Form!NameOfControl

So in your case it might be;

Me![frmSubRoute_SQL].Form![routes] = Me!hdrRoutes
--
_________

Sean Bailey


"TheNovice" wrote:

Good Day All,
(Yes its me again!!!)

I have a Form with a SubForm, the main Form is from tmpHdrRoutes and the Sub
Form is from the source table.

The header information is what can change (i.e. Route Number, Clock-in etc.)
this info needs to be updated to the subform.

I have tried

me.routes = me.hdrRoutes

and it failed,

tried:

forms!frmSubRoute_SQL![routes] = me.hdrRoutes

and this also failed.



--
-The Novice
Learn Today, Teach Tomorrow

Great Success is ones ability to ask for Help.

  #4  
Old June 27th, 2008, 07:39 PM posted to microsoft.public.access.forms
TheNovice
external usenet poster
 
Posts: 67
Default Updating SubForms ! GURU NEEDED!!!!

Thanks Bettle, it worked, but here is what is happening, it only updates the
first record of the subForm. How can I get it to update all of the rows in
the subform?


--
-The Novice
Learn Today, Teach Tomorrow

Great Success is ones ability to ask for Help.


"Beetle" wrote:

To refer to a control on a subform, the syntax is;

Me!SubformControlName.Form!NameOfControl

So in your case it might be;

Me![frmSubRoute_SQL].Form![routes] = Me!hdrRoutes
--
_________

Sean Bailey


"TheNovice" wrote:

Good Day All,
(Yes its me again!!!)

I have a Form with a SubForm, the main Form is from tmpHdrRoutes and the Sub
Form is from the source table.

The header information is what can change (i.e. Route Number, Clock-in etc.)
this info needs to be updated to the subform.

I have tried

me.routes = me.hdrRoutes

and it failed,

tried:

forms!frmSubRoute_SQL![routes] = me.hdrRoutes

and this also failed.



--
-The Novice
Learn Today, Teach Tomorrow

Great Success is ones ability to ask for Help.

  #5  
Old June 27th, 2008, 09:02 PM posted to microsoft.public.access.forms
Klatuu
external usenet poster
 
Posts: 7,074
Default Updating SubForms ! GURU NEEDED!!!!

Something is wrong here. You should not be duplicating data in your
database. the route number and clock in should be in only one table, not
both.

What is the relationship between the two tables? What is the purpose of each
table?

You would be much better off to correct you database design before you go
any further.
--
Dave Hargis, Microsoft Access MVP


"TheNovice" wrote:

Thanks Bettle, it worked, but here is what is happening, it only updates the
first record of the subForm. How can I get it to update all of the rows in
the subform?


--
-The Novice
Learn Today, Teach Tomorrow

Great Success is ones ability to ask for Help.


"Beetle" wrote:

To refer to a control on a subform, the syntax is;

Me!SubformControlName.Form!NameOfControl

So in your case it might be;

Me![frmSubRoute_SQL].Form![routes] = Me!hdrRoutes
--
_________

Sean Bailey


"TheNovice" wrote:

Good Day All,
(Yes its me again!!!)

I have a Form with a SubForm, the main Form is from tmpHdrRoutes and the Sub
Form is from the source table.

The header information is what can change (i.e. Route Number, Clock-in etc.)
this info needs to be updated to the subform.

I have tried

me.routes = me.hdrRoutes

and it failed,

tried:

forms!frmSubRoute_SQL![routes] = me.hdrRoutes

and this also failed.



--
-The Novice
Learn Today, Teach Tomorrow

Great Success is ones ability to ask for Help.

  #6  
Old June 27th, 2008, 09:32 PM posted to microsoft.public.access.forms
TheNovice
external usenet poster
 
Posts: 67
Default Updating SubForms ! GURU NEEDED!!!!

KLATUU,

you are 100% correct in your logic, and if it were upto me I would have
changed it but I inhereted it.

The primary table is only a temporary table. and it has the header
information. the destination table has the info compiled into it for
reporting. at times the data is incorrect or missing. therefore the source
updates the destination.

Please let me know how this can be updated. I realize it is redundant but
the need is there.
--
-The Novice
Learn Today, Teach Tomorrow

Great Success is ones ability to ask for Help.


"Klatuu" wrote:

Something is wrong here. You should not be duplicating data in your
database. the route number and clock in should be in only one table, not
both.

What is the relationship between the two tables? What is the purpose of each
table?

You would be much better off to correct you database design before you go
any further.
--
Dave Hargis, Microsoft Access MVP


"TheNovice" wrote:

Thanks Bettle, it worked, but here is what is happening, it only updates the
first record of the subForm. How can I get it to update all of the rows in
the subform?


--
-The Novice
Learn Today, Teach Tomorrow

Great Success is ones ability to ask for Help.


"Beetle" wrote:

To refer to a control on a subform, the syntax is;

Me!SubformControlName.Form!NameOfControl

So in your case it might be;

Me![frmSubRoute_SQL].Form![routes] = Me!hdrRoutes
--
_________

Sean Bailey


"TheNovice" wrote:

Good Day All,
(Yes its me again!!!)

I have a Form with a SubForm, the main Form is from tmpHdrRoutes and the Sub
Form is from the source table.

The header information is what can change (i.e. Route Number, Clock-in etc.)
this info needs to be updated to the subform.

I have tried

me.routes = me.hdrRoutes

and it failed,

tried:

forms!frmSubRoute_SQL![routes] = me.hdrRoutes

and this also failed.



--
-The Novice
Learn Today, Teach Tomorrow

Great Success is ones ability to ask for Help.

  #7  
Old June 27th, 2008, 09:48 PM posted to microsoft.public.access.forms
Klatuu
external usenet poster
 
Posts: 7,074
Default Updating SubForms ! GURU NEEDED!!!!

It depends on where you want to do the update. For one thing, you have to
have the row in the subform you want to update be the current row. When you
reference a control on a datasheet subform, it will return the value of the
control for the current row. If you programmatically change the value of a
control on a datasheet subform, it will change the value for the control in
the current row.

So, If you can tell me when you want to do this, I can show you the code
that will do it.
--
Dave Hargis, Microsoft Access MVP


"TheNovice" wrote:

KLATUU,

you are 100% correct in your logic, and if it were upto me I would have
changed it but I inhereted it.

The primary table is only a temporary table. and it has the header
information. the destination table has the info compiled into it for
reporting. at times the data is incorrect or missing. therefore the source
updates the destination.

Please let me know how this can be updated. I realize it is redundant but
the need is there.
--
-The Novice
Learn Today, Teach Tomorrow

Great Success is ones ability to ask for Help.


"Klatuu" wrote:

Something is wrong here. You should not be duplicating data in your
database. the route number and clock in should be in only one table, not
both.

What is the relationship between the two tables? What is the purpose of each
table?

You would be much better off to correct you database design before you go
any further.
--
Dave Hargis, Microsoft Access MVP


"TheNovice" wrote:

Thanks Bettle, it worked, but here is what is happening, it only updates the
first record of the subForm. How can I get it to update all of the rows in
the subform?


--
-The Novice
Learn Today, Teach Tomorrow

Great Success is ones ability to ask for Help.


"Beetle" wrote:

To refer to a control on a subform, the syntax is;

Me!SubformControlName.Form!NameOfControl

So in your case it might be;

Me![frmSubRoute_SQL].Form![routes] = Me!hdrRoutes
--
_________

Sean Bailey


"TheNovice" wrote:

Good Day All,
(Yes its me again!!!)

I have a Form with a SubForm, the main Form is from tmpHdrRoutes and the Sub
Form is from the source table.

The header information is what can change (i.e. Route Number, Clock-in etc.)
this info needs to be updated to the subform.

I have tried

me.routes = me.hdrRoutes

and it failed,

tried:

forms!frmSubRoute_SQL![routes] = me.hdrRoutes

and this also failed.



--
-The Novice
Learn Today, Teach Tomorrow

Great Success is ones ability to ask for Help.

  #8  
Old June 27th, 2008, 10:36 PM posted to microsoft.public.access.forms
TheNovice
external usenet poster
 
Posts: 67
Default Updating SubForms ! GURU NEEDED!!!!

what I was able to do was take the two keys from both tables and created an
Update Query and put it in a macro.

It works just fine. Plus i added a Requery to refresh the data.

KLATUU, you are good, and thanks for the advice.
--
-The Novice
Learn Today, Teach Tomorrow

Great Success is ones ability to ask for Help.


"Klatuu" wrote:

It depends on where you want to do the update. For one thing, you have to
have the row in the subform you want to update be the current row. When you
reference a control on a datasheet subform, it will return the value of the
control for the current row. If you programmatically change the value of a
control on a datasheet subform, it will change the value for the control in
the current row.

So, If you can tell me when you want to do this, I can show you the code
that will do it.
--
Dave Hargis, Microsoft Access MVP


"TheNovice" wrote:

KLATUU,

you are 100% correct in your logic, and if it were upto me I would have
changed it but I inhereted it.

The primary table is only a temporary table. and it has the header
information. the destination table has the info compiled into it for
reporting. at times the data is incorrect or missing. therefore the source
updates the destination.

Please let me know how this can be updated. I realize it is redundant but
the need is there.
--
-The Novice
Learn Today, Teach Tomorrow

Great Success is ones ability to ask for Help.


"Klatuu" wrote:

Something is wrong here. You should not be duplicating data in your
database. the route number and clock in should be in only one table, not
both.

What is the relationship between the two tables? What is the purpose of each
table?

You would be much better off to correct you database design before you go
any further.
--
Dave Hargis, Microsoft Access MVP


"TheNovice" wrote:

Thanks Bettle, it worked, but here is what is happening, it only updates the
first record of the subForm. How can I get it to update all of the rows in
the subform?


--
-The Novice
Learn Today, Teach Tomorrow

Great Success is ones ability to ask for Help.


"Beetle" wrote:

To refer to a control on a subform, the syntax is;

Me!SubformControlName.Form!NameOfControl

So in your case it might be;

Me![frmSubRoute_SQL].Form![routes] = Me!hdrRoutes
--
_________

Sean Bailey


"TheNovice" wrote:

Good Day All,
(Yes its me again!!!)

I have a Form with a SubForm, the main Form is from tmpHdrRoutes and the Sub
Form is from the source table.

The header information is what can change (i.e. Route Number, Clock-in etc.)
this info needs to be updated to the subform.

I have tried

me.routes = me.hdrRoutes

and it failed,

tried:

forms!frmSubRoute_SQL![routes] = me.hdrRoutes

and this also failed.



--
-The Novice
Learn Today, Teach Tomorrow

Great Success is ones ability to ask for Help.

 




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


All times are GMT +1. The time now is 11:37 PM.


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