Copy record to new tab

mitchem1

Registered User.
Local time
Today, 14:28
Joined
Feb 21, 2002
Messages
153
Let's say I have a form with multiple tabs. If the various tabs are clicked, the form always looks the same. Would it be possible to have it so that only the left most tab (say tab A) contains data and other tabs (B, C, etc.) are empty? But by clicking a button, the user can duplicate the data in tab A to tab B if necessary, and to C if necessary, and so on and so on? I'm using Access 2007. Thanks in advance.
 
Yes. There's two ways I can see that you might mean:

One is there's a repeated set of fields in the underlying table, one set for each tab.
In that case you would just copy the values of corresponding fields from one to tab's fields to the new (txtNameFieldPage2.Value = txtNameFieldPage1.Value)
Or, there are subforms on each tab showing a separate record from the same table (or possibly different tables with the same structure).
You would then tell the subform on the relevant page to go to a new record (DoCmd.GoToRecord acDataForm, Me.Name, acNewRec) and then set its fields equal to the values of the fields on the source page's subform (subForm2.Form.txtName.Value = subForm1.Form.txtName.Value)

In either case I would recommend making all empty tab pages invisible until they're needed (the button is clicked) rather than just empty but available, unless there's a reason to allow the user to edit them in any order without clicking a button.
 
My biggest question is WHY? Why would they be duplicating and duplicating data? Sounds a bit suspicious as a potential database structure issue to me.
 

Users who are viewing this thread

Back
Top Bottom