I removed the dirty line just to continue to test it and I get another
error:
"You entered an expression that has an invalid reference to the
RecordsetClone property."
Here is my code for that
With Me.RecordsetClone
.AddNew
![JWO_Date of Order] = Me.[JWO_Date of Order]
![JWO_Job Type] = Me.[JWO_Job Type]
![JWO_Customer's Order Number] = Me.[JWO_Customer's
Order
Number]
![JWO_Subcontract Number] = Me.[JWO_Subcontract Number]
![JWO_Customer] = Me.[JWO_Customer]
![CU_Customer Address] = Me.[CU_Customer Address]
![CU_Customer City] = Me.[CU_Customer City]
![CU_Customer State] = Me.[CU_Customer State]
![CU_Customer Postal Code] = Me.[CU_Customer Postal
Code]
![CU_Customer Phone Number] = Me.[CU_Customer Phone
Number]
![CU_Customer Fax Number] = Me.[CU_Customer Fax Number]
![JWO_Contact] = Me.[JWO_Contact]
![JWO_Project Manager] = Me.[JWO_Project Manager]
![PM_Cell Phone Number] = Me.[PM_Cell Phone Number]
![PM_E-Mail Address] = Me.[PM_E-Mail Address]
![JWO_Project Superintendent] = Me.[JWO_Project
Superintendent]
![JS_Cell Phone Number] = Me.[JS_Cell Phone Number]
![JWO_Project Name] = Me.[JWO_Project Name]
![PJ_Address] = Me.[PJ_Address]
![PJ_City] = Me.[PJ_City]
![PJ_County] = Me.[PJ_County]
![PJ_State] = Me.[PJ_State]
![PJ_Postal Code] = Me.[PJ_Postal Code]
![JWO_Insurance Company] = Me.[JWO_Insurance Company]
![JWO_Insurance Contact] = Me.[JWO_Insurance Contact]
![IC_Phone Number] = Me.[IC_Phone Number]
![IC_E-Mail Address] = Me.[IC_E-Mail Address]
![JWO_Exterior Start Date] = Me.[JWO_Exterior Start
Date]
![JWO_Interior Start Date] = Me.[JWO_Interior Start
Date]
![JWO_Description of Work] = Me.[JWO_Description of
Work]
![JWO_Date Requested for Final Inspection] =
Me.[JWO_Date
Requested for Final Inspection]
![JWO_Invoice Date] = Me.[JWO_Invoice Date]
![JWO_Retainage] = Me.[JWO_Retainage]
![JWO_Permit Number] = Me.[JWO_Permit Number]
![JWO_Map Number] = Me.[JWO_Map Number]
![JWO_Parcel Number] = Me.[JWO_Parcel Number]
![JWO_Date Completed] = Me.[JWO_Date Completed]
![JWO_AFPI Sales Representitive] = Me.[JWO_AFPI Sales
Representitive]
![JWO_Date Warranty Begins] = Me.[JWO_Date Warranty
Begins]
![JWO_Prevailing Wage] = Me.[JWO_Prevailing Wage]
![JWO_Time and Material] = Me.[JWO_Time and Material]
![JWO_Firm Quote] = Me.[JWO_Firm Quote]
![JWO_Special Pay Application Form] = Me.[JWO_Special
Pay
Application Form]
![JWO_Schedule of Values] = Me.[JWO_Schedule of Values]
![JWO_Tax Exempt] = Me.[JWO_Tax Exempt]
![JWO_Quote Amount] = Me.[JWO_Quote Amount]
.Update
.Bookmark = .LastModified
lngID = !OrderID
Me.Bookmark = .LastModified
End With
:
This code looks like what the wizard generates, but there are lots of
reasons why it can fail.
For example, if the form's RecordSource is a query that uses more than
one
table, the append may try to append values to fields from the other
tables,
which will fail. Similarly, if there are calculated controls, the
append
won't work for them.
A safer approach is to specify the fields you do want to copy. This is
also
more flexible, e.g. you can date the the record as today, while
duplicating
the other fields.
This article:
Duplicate the record in form and subform
at:
http://allenbrowne.com/ser-57.html
explains how to specify the fields to duplicate. (You can just ignore
the
part about duplicating related records in the subform as well.)
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Reply to group, rather than allenbrowne at mvps dot org.
I have a form for Job Work Orders. I have created a button to copy
the
current reccord into a new one, but it doesn't work. I get this
error:
"Records that Microsoft Office Access was unable to pase have been
inserted
into a new table called 'Paste Errors.'
But it doesn't say what the error is...
Here is my code:
Forms("Job Work Orders Form").SetFocus
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 2, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 5, , acMenuVer70 'Paste
Append