Re: Duplicate the record in form and subform

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Whatever method you're using to create your PK is going to have to be done
programmatically in your code i.e.

With Me.RecordsetClone
.AddNew
![PK field] = some value
!CustomerID = Me.CustomerID
!EmployeeID = Me.EmployeeID
!OrderDate = Date
'etc for other fields.
.Update

--
_________

Sean Bailey


"Andy" wrote:

Hi Allen,

Sorry for the typo error on the field name! Have corrected but another error
message is "error#3058, primary key value can not be null" caused by below
line :
.update
Have mentioned that my primary key value is not a autonumber, please advise
how to change the code to fit my database.
Thanks again!

"Allen Browne" wrote:

Presumably we are talking about this article:
http://allenbrowne.com/ser-57.html

The "Item not found" error was caused by which line?
Whichever line it is, you have some name Access can't identify, e.g. you
have not changed the field names to match what's in your form.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Andy" <Andy@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:F433142D-F96C-41EC-AD9F-8408A6D669A4@xxxxxxxxxxxxxxxx
Hi Allen Browne,

I try to use your code to duplicate the record in form and subform but I
got
a error message "Error#3265". BTW, my primary key value is not autonumber,
how to change the code to fit my database?
Thanks for your expert comments in advance!


.



Relevant Pages

  • Re: index error 3800 "fieldname" is not an index in this table
    ... Then when you make the field the primary key, ... I suggest you do delete the entries so Access doesn't ... Allen Browne - Microsoft MVP. ... Tips for Access users - http://allenbrowne.com/tips.html ...
    (microsoft.public.access.modulesdaovba)
  • Re: #Name? returned on form
    ... Look at the RecordSource property of the form. ... Allen Browne - Microsoft MVP. ... Tips for Access users - http://allenbrowne.com/tips.html ... Then compact the database: ...
    (microsoft.public.access.forms)
  • Re: Why no links creat automatically, when use tools-->relationshi
    ... I think there must be primary key and links seted for each table, ... Allen Browne - Microsoft MVP. ... It is possible that the original designer did not use an relationships. ... I did Link to that database, since it has 600+ tables, and some tables ...
    (microsoft.public.access.reports)
  • Re: index error 3800 "fieldname" is not an index in this table
    ... Then when you make the field the primary key, ... Allen Browne - Microsoft MVP. ... Perth, Western Australia ... Tips for Access users - http://allenbrowne.com/tips.html ...
    (microsoft.public.access.modulesdaovba)
  • Re: Designing and Access Questions
    ... Tips for Access users - http://allenbrowne.com/tips.html ... one client has many orders. ... Therefore the Clients table has a ClientID (primary key), and the Orders table has a ClientID The primary table is the on on the ONE side of the ... If you have not yet done so, open the Northwind sample database, open the Relationships window, and see how those relations work. ...
    (microsoft.public.access.tablesdbdesign)