I've trawled through every answered page on this forum without finding the answer to this question. Hopefully someone out there will be able to help.
I have a table in a repeating subform. The data entered into the inital table may (or may not) need to be replicated in the following instance of the table.
I'd like to be able to place a checkbox above the table that if checked will populate the new instance of the table with the data from the first instance (and so on if multiple instances are required). I thought about global binding but I really need the option of the checkbox (or radio button if someone feels this would be a better option) as the second (or third) instance of the table may need to contain different data than the first table.
Any suggestions for this would be MUCH appreciated.
I have a few examples here of similar functionality.
The first one repeats the data in the table if the field is not null. This is so the table only prints rows that contain data. The blog goes into a bit of detail: http://assure.ly/fpiuQK, but you can download the form here: http://assure.ly/hZFh1S. You should have a look at the second 'print' button.
The second example duplicates the data from one table to another. Because in a dynamic table you cannot use the global binding property, this solution involves some script in the exit event. http://assure.ly/hwIaaw.
Our site seems a little slow this morning, so please be patient. I'll put a bit more coal in the burner.
Hope that helps,
Thanks Niall for the prompt response. I had actually come across both examples in my searching, however my form contains one table on a page. If the user clicks a button (Add Another Location) the form replicates this page (along with a number of other pages, thus giving me a new blank table). It is at this point that I would like the option of being able to copy the data from the first table instance into the second and so on but only if needed (hence the idea of using a checkbox to trigger the process).
Hope this sheds a little more light on my problem.
If this is somewhat confusing I'm more than happy to send you a copy of the file so you can have a look.
I think the basic approach can be adapted to suit your case. Basically you would need to set up a loop to run through the rows in the previous instance of the table and look at the value in the checkboxes.
A couple of things:
I think the first example: Assure Dynamics Duplicate table data if not null.pdf is very close to what you want. The only thing left to script is the target instance of the table that you want.
I am in/out of the office at the moment, but if you upload the form to a file sharing site and post the published link here I will try and have a look.
Here's the link
The table is found on the second last page.
You can add rows to the table.
There could be more than two instances of the table but for my purposes replicating data from the first instance is all that's necessary.
The checkbox in the first instance is hidden until a "New Location" has been added and currently sits outside the table as a question.
Sorry Michael, I was out today and will be on the missing list tomorrow as well. The earliest I will get to look at this will be Friday.
Having just a quick look though, I think that there may be a few issues. With the checkbox there are two criteria resulting in the data being copied down: (1) if the checkbox is selected when the add instance is clicked, and (2) when the checkbox is ticked and there is more than one instance of the table.
Taking the checkbox approach, I think you would also need to have the script fire when the checkbox is ticked to 1. For example, if the user adds more instances and fills in, say three instances of the table. If they then went back and ticked the checkbox, what action do you want?
I think a more direct route would be a button that appears above the table in the second and subsequent instance. The caption would be "Copy your information from the previous table", or something similar. This is a more positive action that is applied at whatever instance of the table that the user wants. In addition the table, the button and the result when its clicked are all in the same view.
I agree with your suggestion of using a button for this. What are the chances of being able to send you the .tds file so you can give me some direction regarding the scripting I may need to get it working.
Additionally I would probably like to see the button populate a new instance of the table with the data from the previous instance (as opposed to taking the data from the very first instance each time).
Thanks again for your help, much appreciated.