Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error by duplicating form/subform record 1

Status
Not open for further replies.

malbreht

Technical User
Dec 8, 2006
63
0
0
SI
Hi!

I've followed the instructions at , adapted the names to my DB, however when pushing the button "Duplicate", I get the error:
Code:
Item not found in this collection.

And nothing happens - not even in VB there's no row highlighted!

Any ideas what could be the problem?

________________
Thanks,

Mare [thumbsup2]
 
One of the field names you use (or other objects?), doesn't exist, or has a typo, I think.

Comment out the "on error goto..." line, then it should highlight the offending line.

Roy-Vidar
 
Make sure you have entered correct field names in the code.

Code:
With Rst
   .AddNew
      [b]!CustomerID[/b] = Me!CustomerID
      [b]!EmployeeID[/b] = Me!EmployeeID
      '.....
   .Update                     
   .Move 0, .LastModified
End With

________________________________________________________
Zameer Abdulla
Help to find Missing people
Sharp acids corrode their own containers.
 
Comment out the "on error goto..." line, then it should highlight the offending line.

Jep, now it's all [highlight]yelow[/highlight] :)

I'm trying to solve all issues now. Thanks for now.

________________
Thanks,

Mare [thumbsup2]
 
Hi,

I discovered some errors and corrected them, but here is where I got stuck. I get an error:

Code:
Run-time error '3127':
The INSERT INTO statement contains the following unknown field name: 'Forms!frmPurchase.Tag'Make sure you have typed the name correctly, and try the opearation again.
In VB the query is highlighted:
Code:
DoCmd.SetWarnings False
[highlight]DoCmd.OpenQuery "Duplicate Order Details"[/highlight]
DoCmd.SetWarnings True

"frmPurchase" in my query is typed correctly so I'm not sure, what is the problem. Any ideas?

________________
Thanks,

Mare [thumbsup2]
 
Can you post the complete code here?

________________________________________________________
Zameer Abdulla
Help to find Missing people
Sharp acids corrode their own containers.
 
This would probably be easier when seeing the SQL of the query - but I think you are trying to insert into the field Forms!frmPurchase.Tag (which doesn't exist), and I think that value is supposed to be a criterion (in the where clause) in stead

i e remove from there

INSERT INTO YourTable (..... Forms!frmPurchase.Tag ....)

set it in the where clause

WHERE YourTable.YourPK = Forms!frmPurchase.Tag

Or in the query grid, cut it from the "append to" row, and paste it into the "criteria" row

Roy-Vidar
 
Oh my god, you're totally right, RoyVidar! I accidently pasted it into the "append" row, instead of the "criteria" row...

Thank you very much indeed! It works!

Thanks to you, ZmrAbdulla as well. (Nice homepage, btw!)

________________
Thanks,

Mare [thumbsup2]
 
glad to know it sorted.

I was out from the net for two days.

________________________________________________________
Zameer Abdulla
Help to find Missing people
Sharp acids corrode their own containers.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top