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 said:
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 said:
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
:
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.
:
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
:
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.