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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|