I Need To Duplicate A Record Including The Subform

Mar 8, 2006

I want to be able to copy, or duplicate a record including all the associated records of the subform. The structure is the typical, ORDERS, ORDER DETAIL, PRODUCTS. I want to be able to copy a specific ORDER and generate a new one with all associates products. It would be nice to change one field (ORDER NAME), changing the ORDER name would simulate the "Save As.." command.

The end result would be a new Order identical to the first one (including all sub items) but with a different name.

Any suggestions?

Leonardo

View Replies


ADVERTISEMENT

Modules & VBA :: Unable To Create Duplicate Record On Subform

Nov 29, 2013

I am trying to create duplicate records from a main form frmManagers which has a subform frmSubMeasure. I have placed the duplicate button on the main form. It creates a duplicate of the main form data and gives me the option to add new record to the sub. I want the duplicate to be created on the sub form for me to just edit the scores.

I don't know how to pass the sub form data to be duplicated I thought the append query which I used would update the tblSubMeasure table which created the subform frmSubMeasure.
In the sub the append query do update the form with the new MeasureID from the mainform and the form is available to enter new data. I want the subform data to be duplicated as well

In the query I included all the fields from the tblSubMeasure table and this is appended to the same table tblSubMeasure and I place a tag on the MeasureID using "[Forms]![frmManagers].[Tag]"

Code:
Private Sub btnDuplicate_Click()
Dim dbs As DAO.Database, Rst As DAO.Recordset
Dim F As Form
'Return Database variable pointing to current database.
Set dbs = CurrentDb
Set Rst = Me.RecordsetClone

[Code] .....

View 1 Replies View Related

Printing Report From Form Including Subform

Aug 31, 2006

Hi there,

I am trying to save my form that i have created as a report by right clicking on the form and choosing save as report. However, my form includes a subform but the subform does not show up in the report. Any ideas as to why this and how it can be shown????

Thanks in advance

Lucy

View 2 Replies View Related

Queries :: Including Record That Is Inside Excluded Range

Oct 2, 2014

Including a record that's inside an excluded range.

I have a table with record numbers from 1 to 91599. I want to exclude records from 91011 to 91599 but I don't want to exclude record 91102.

How do exclude a record that is included in the excluded range?

I could write two queries the first will excludes 91011 to 91101 and the second excludes 91103 to 91599. Is this the only way?

View 3 Replies View Related

Query From (and Including) Date - Thru (and Including) Date

Jun 16, 2006

Access 2000
Hi All.

I am running a select query on a date field.

I populate the table "date" field from a Microsoft Date and Time Picker Control 6.0(SP6).
I havent been able to figure out how to ONLY populate the date portion of the control so my field value containes Date & Time.

When I run the query, I have to select the day after my request to include the records I need. I think this is because of the time in the field
Example, If I want all records thru 6/17/2006 I must select "thru" 6/18/2006. This mucks things up if I have records dated 6/18/2006

Both of these statements give the same bad results:

Between [forms]![freports]![from] And [forms]![freports]![thru]

>=[forms]![freports]![from] And <=[forms]![freports]![thru]

Any ideas?
TIA
Detrie

View 1 Replies View Related

Forms :: Highlight Unbound Subform Record That Matches Other Subform Record

Jan 22, 2014

I have two unbound unlinked subforms residing on a 3rd unbound main form. When I enter the current record on Subform1 I would like the matching record(s) on Subform2 to be highlighted or otherwise formatted. I can get this to work for only the first record on subform2 due to the way I have my code setup on Subform1:

Code:
Private Sub Accounting_Unit_Enter()
'find where AUs match. only works for first Subform2 record
If Me.[Accounting Unit] = Forms!MainForm.[Subform2]!AccountingUnit Then
msgbox "Match"
End If
End Sub

My thought was that I needed to reference the Recordset of Subform2 and search for all AccountingUnits that match the current AccountingUnit of Subform1,

View 6 Replies View Related

Subform Duplicate Information

Nov 1, 2005

I have a form with a subform attached.

on the Main form you select the student then you enter letters sent out in the subform.

Basically there may be 22 letters going out all the same just to different students.

so the standard letter type will always be the same as will the date field
I know you can duplicate a record if its the same student saw that in the wizard however is there away of "holding" the information in certain fields so that its autoamatically filled in when you select the next student?

View 2 Replies View Related

Using A Command Button To Duplicate A Subform

Jul 12, 2006

Hi,

I am by no means an expert... probably demonstrated by this question:

I am trying to use a command button to duplicate the contents of a subform within that subform box. There are five fields that I would like to appear below the five already in existence when the command button is clicked.

Does anyone know how to accomplish this?

Thanks!

View 2 Replies View Related

Forms :: How To Duplicate Subform Records

Jun 25, 2015

How to duplicate records in SubForm, i have created a form (transmittal) with a subform that contains all items listed:

Master Field : Transmittal No
Child Fields: IDTransmittalNumber

There is a button that allows me to duplicate form , however when i change the Transmittal no in the main form it automatically deletes all data in subform since they are both linked by that field..

View 8 Replies View Related

Forms :: Subform Storing Duplicate Values

Jan 20, 2015

I am fairly new to using access and am currently creating a database for a small bakery. They have new legislation whereby they have to list all their product ingredients and any allergens in the ingredients must be shown in bold.

So far I have 3 tables as follows:

Products (*ProductID, ProductName, Photo)
Ingredients (*IngredientID, Ingredient, Allergen)
Product_Ingredients (ProductID, IngredientID)

I have 2 forms set up:

one to input ingredients and a checkbox if it is an allergen

The other has a main form and subform to get ProductName, Photo and then a combo box in the subform to add ingredients.

Everything appears to be working ok but I have an issue with my subform. The combo box has no duplicates and lists the ingredients in alphabetical order as I require. However, if I view the subform separately from the main form I see that it is storing all the ingredients selected for each product. Therefore it is storing a lot of duplicate information.

View 3 Replies View Related

Forms :: Duplicate Button For Form / Subform

Sep 7, 2013

My programming abilities are mediocre, but not novice.I have a pretty large scale management system to build (more than 40 tables, lots of relationships, forms, etc). One of the structures in the database is the following:

+ Main table
++ Secondary table connected to Main table via FK1.
+++Tertiary table connected to Secondary table via FK2.

The above when making the user interface is expressed as a form (Main Table), a subform (Secondary table) and a subform within the subform (Tertiary table).

I need to create a button that duplicates the contents of the main table, the secondary table and the tertiary table. I have already been able to create a button that duplicates the contents of the main table and the secondary table by using Allen Browne's code found online.how do I move forward to embedding in that method the ability to duplicate the contents of the Tertiary Table?

View 2 Replies View Related

Forms :: Subform Creates Duplicate Records

Aug 29, 2013

I have a form that uses Table A as a record source and has a subform that uses Table B as a record source. There is a one to many relationship between Table A (one) and Table B (many).The user opens the form to a set record, then uses the subform to create a new record in Table B.

This works perfectly and I can do everything I want. But sometimes the subform creates a blank entry in Table B before I enter any data. Then, once I start entering data, it creates another record in which it stores the data that I am entering.The result is two records: One that only has the date of the record's creation (I set that to be automatic upon creating a new record) and the primary key that links Table B to Table A. A second one is the "true" record, the one which stores all of the data that I am entering.

It won't happen for 10 records or something and there is no apparent pattern. In case it makes a difference, the form is set to open as the subform as the focus.

View 14 Replies View Related

Reports :: Multiple Duplicate Records In Subform

Mar 9, 2015

I currently have a report which contains a subform. The master/child fields used to link them are called 'StudentID'.

In the table on which the subform is based, it is possible for multiple records to be associated with a single StudentID: in this case, the subform shows the locations where a student is studying, therefore if a student is based in three different locations the subform will display all three.

This seems to be resulting, when I run the master report, in three identical iterations of the same report being displayed (at least this is the only reason i can see why these duplicates would be displayed; it doesn't happen if a student only has one record in the subform).

Clearly, as a single instance of the report shows all three records in the subform anyway, I don't want to be seeing these duplicates.

View 5 Replies View Related

General :: Prevent Duplicate Entries In A Subform

Oct 22, 2014

I have a mainform (F_main) and a subform associated (F_place).

F_place is the form of the table T_place.
T_place is linked to F_main by the field "BizNumber". I also have the field "Place" and of course the "Place ID" (primary key) in T_place.

"Place" in linked to a combobox (in F_place).I want to avoid, at a given "BizNumber", the same "place" to be entered in the F_place.

View 6 Replies View Related

Forms :: Subform Continuous Combobox Duplicate Value?

Jun 25, 2015

I am setting up a subform in continuous with combobox, but when I enter the data on the first combobox, it duplicated to all the following records. Is there a way to stop that?

View 2 Replies View Related

Modules & VBA :: Unable To Create Duplicate Records On A Subform?

Nov 20, 2013

I am working with a sub-form where once a staff member enters there sub measure I would want to create a duplicate of that record. The problem I am having is that once you enter the sub-form and click the duplicate button it creates a duplicate of the record selected but overwrites the first record in the table. I want it to create a new SubMeasure Number which is the primary key and assigns the record the next available number.

Also if I try to add another record after one has been added I get runtime error "3021" - No current record. I would have to close the form and reopen for it to be able to add again.

I have attached the code below:

Private Sub cmdDuplicate_Click()Dim dbs As DAO.Database, Rst As DAO.Recordset
Dim F As Form
'Return Database variable pointing to current database
Set dbs = CurrentDb
Set Rst = Me.RecordsetClone

[code]....

View 4 Replies View Related

Queries :: Insert Into Query - Duplicate Records In A Subform To New Form

Jun 4, 2013

I'm trying to duplicate the records in a subform to a new form but keep getting a too few parameters error.

Code:
strSql = "INSERT INTO [OrderDetailT] ( OrderID, ProductID, Quantity, DiscountPercentage ) " & _
"SELECT " & lngID & " As NewOrderID, ProductID, Quantity, DiscountPercentage " & _
"FROM [OrderDetailT] WHERE OrderNumber = " & Me.OrderNumber & ";"

The debug.print comes out as below:

INSERT INTO [OrderDetailT] ( OrderID, ProductID, Quantity, DiscountPercentage ) SELECT 49 As NewOrderID, ProductID, Quantity, DiscountPercentage FROM [OrderDetailT] WHERE OrderT!OrderNumber = 11;

View 4 Replies View Related

Modules & VBA :: Create X Number Of Duplicate Records According To A Field On Subform

Jun 13, 2013

I have a code that works great from the parent form but I decided to change the format and call it from a lostfocus event in the subform instead. Now I keep getting error 3314:"You must enter a value in the tbGuests.LastName field".

The code should copy the parent form fields and create x number of duplicate records according to a field on sub-form. It then runs an append query to add the information from the subform.

Code:

Private Sub GuestsInParty_LostFocus()
Dim partymsg As Integer
Dim dbs As dao.Database, rst As dao.Recordset
Dim F As Form
Dim intHowMany As Integer
Dim intCounter As Integer

[code]....

View 1 Replies View Related

Duplicate A Record

Apr 12, 2005

I have a database with a table that uses a numeric field as a PK. If I use the built in "Duplicate" Command button on a form it creates an exact duplicate of the record, which then Access won't allow because the PK is no longer unique.

Does anyone know of a way that I could make the number be the max number + 1 when I click the "Duplicate" Button?

Thanks

View 1 Replies View Related

Forms :: Underlying Query In Subform Creating Duplicate Records On Form

Jun 18, 2014

I have an "Returns" master form that contains two subforms. The subforms contain items that we are returning back into our inventory. The underlying queries in each subform show only those records where the "Return Date" is null. The query(s) works fine, except that if there are 3 items that need to be returned there are 3 records that show in the master Returns form. I tried the Totals option in the query but the I need that Return Date on the subform. I only want one Returns master form to show the 3 records (not 3 records of the same master form).

View 5 Replies View Related

How T Prevent Duplicate Record Set

Mar 11, 2006

Hi All,

I have a recored set and i dont want a duplicate of the record set in the same table.

Say if my table name is businessskills and contains three fields(columns) and their names(Email , B_code, Rating) highlighted in red with data are as below

Email B_code Rating
hugh@hp.com b001 1
hugh@hp.com b002 3
hugh@hp.com b005 2
ston@hp.com b002 3
ston@hp.com b007 3

I have 5 recordsets in my table as shown above and i want to prevent any e duplicates.

Is this possible to implement to with excel vba code or directly in Access Database, either ways is fine with me.

Can any one please help me with this.

Thanks in advance

View 1 Replies View Related

Duplicate Record Error

Dec 21, 2006

I'm trying to make a simple DB that we can enter our time for working on projects.

So far I have a Form with the employees name and the date in it. Then below that is a subform with the project number, name, client name, and hours.

I want to use this whole "sheet" for one days worth of work for 1 employee. New sheets will be used for each day.

When I try to make a new sheet I get an error that it cant change the table because it would be creating a duplicate entry.

How do I solve this?

Also, should it be difficult to be doing what I'm trying to do?

View 2 Replies View Related

Duplicate Record Problem

Jul 13, 2007

The access table has one primary key StudentID which is indexed with no duplicates. (StudentID consists of schoool ID + an auto increment #)

When a second student is entered with the same name and birthdate into the table but with a different studentid the record cannot be saved as there is a duplicate value. If the birthdate is removed the record can be saved. If another character is entered after the first name with the birthdate the record can be saved.

I have tried adding time to the record, that did not solve it. I tried changing name and birthdate to index yes duplicates okay that did not solve it.

The only relationship is on studentid, I cannot understand why the birthdate is the problem when there is no relationship or primary key on that value.

Has anyone experienced this issue and can explain why access views this as a duplicate record when in fact it is not!

Thanks

View 5 Replies View Related

Duplicate Record Error

Aug 17, 2005

hi everyone,

i have a form that i'm trying to create a button to duplicate the record. i'm using the control wizard which produces the following code:

Private Sub DuplicateRecord_Click()
On Error GoTo Err_DuplicateRecord_Click


DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 2, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 5, , acMenuVer70

Exit_DuplicateRecord_Click:
Exit Sub

Err_DuplicateRecord_Click:
MsgBox Err.Description
Resume Exit_DuplicateRecord_Click

End Sub

When i try to execute the code via a comand button, i get an error and the duplicate record operation does not occur. one thing i noticed is that i have a lot of lookup fields (i.e. FK's to lookup tables one-to-many relationships) in underlying table being populated by the form. i've created combo boxes on the form to populate the FK's in the underlying table. the error that occurs when trying to use the above code produces a "paste errors" table and in that paste errors table instead of the bound column values from the combo boxes (i.e. PK values from the lookup tables) it shows the display values from the combo boxes. i'm not sure if this has do with anything, but i couldn't figure out why it was doing this.

does anyone have any ideas how i could get this duplicate record procedure to work?

many thanks for any help or suggestions.

View 1 Replies View Related

Duplicate Whole Record (in Form)

Dec 2, 2005

I have a form (with subform in it) and i fill it with different values. After some time, i need to fill another record (new one), with similar values.Is it possible to make a duplicate of my previous record, and put it in the "new record" so that i won't have to fill all fields again, only change excisting ones to different values.

Thanks

View 11 Replies View Related

Forms :: Go To Record If Duplicate?

Mar 13, 2014

On my form I've got an afterupdate event that checks if the information entered already exists and this works absolutely fine. However what I would like is the option to go to the existing record if one is found, but I can't get it to work.

This is my code currently;

Code:
Private Sub Job_No_AfterUpdate()
If DCount("*", "PACKING", "[Job No>]='" & Me.[Job No] & "'") > 0 Then
If MsgBox("Job Number already exists! Go to record?", vbYesNo, "DST PLANNER") = vbYes Then
Dim rs As Object

[Code].....

The check for the Job Number works fine but when I click Yes on the message box, the form stays on the current record instead of moving to the existing record.

View 14 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved