Results 1 to 5 of 5
  1. #1
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    Leuven, Vlaanderen, Belgium
    Posts
    322
    Thanks
    9
    Thanked 0 Times in 0 Posts

    Can't copy paste new data into form (2K/XP)

    Hi, all,
    I don't succeed solving this issue - can someone help me out?
    In attachment you find the relevant database parts.

    I have a subform (*) in which I'm not able anymore to copy-paste records, while
    - I can copy-paste in another subform (for another table) (**)
    - I can copy-paste in the source table to which the odd behaving subform relates (***);
    - I can manually fill in (the same) data in this subform.

    E.g. I can fill in a new record identical to the one which is already there but I can't copy paste this existing row's cells into a new row.

    Any suggestions?

    (Or has my database just turned corrupted...?
    It used to work... and turned out odd when I tried to fix something through code which didn't work out and is deactivated now).

    Hasse

    (*) fsubDossier_ProjectOrig, labelled 'Projects backup' in the main form
    (**) fsubDossier_Project, labelled 'Projects'in the main form
    (***) tblProjectOrig

    ps Fyi: I understand this setup might seem a little odd... but I want to save you from explaining the way I got here unless it's needed to solve the situation.
    My initial problem was that I need a backup copy of all entered records' original data (copy-pasted from more than 100 excel files, all with the same format) so I can list at a later stage any changes that have been made during the further processing of these data. One way to achieve a copy, I thought, was to let me & my collegues enter the data twice (the second time by copying pasting them to the 'backup' table through another identical subform in the same main form. I know this is very inconvenient etc, but as my programming skills aren't optimal and I didn't have time to figure out better ways for the moment (important deadline passed already) I did it this way...
    At an earlier stage when I was trying to accomplish the backup through code (adding a new record to the ...Orig table each time a records was inserted in the main table), I got an error pointing at double values in a unique indexed field, although I didn't see how that could happen. After I deactivated the code to return to the manual copy-paste situation (and maybe some other steps which I don't remember) I ended up with this situation.
    Attached Files Attached Files

  2. #2
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Can't copy paste new data into form (2K/XP)

    The Allow Edits property of the subform is set to No. Change that to Yes, and you can paste in records.
    Regards
    John



  3. #3
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    Leuven, Vlaanderen, Belgium
    Posts
    322
    Thanks
    9
    Thanked 0 Times in 0 Posts

    SOLVED - Re: Can't copy paste...

    John, thanks for your reply. It also cleared the way to solve a deaper (stupid) problem: the subforms lacked their ID field and that's pretty essential :-p. As such the ID field wasn't copy-pasted along... and received it's default value with the first record added... and again with the other records, generating a double value - key conflict error for each of them (preventing further copy-pasting). (fyi: I used a long number key for the backup table's ID instead of an autonumber in order to give it the same value as in the 'normal' table so you can easily relate them afterwards.)

    The problem with the 'Allow editions' property still feels odd as I remember it not being an issue when I dreated this form: I could copy-paste. You just couldn't modify the added records afterwards (which was as intended). Can't figure out why it doesn't work anymore now, but I'll leave it for what it is.
    Thanks again,
    Hasse

  4. #4
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    SOLVED - Re: Can't copy paste...

    Actually you can paste in the records with the Allow Edits at No, if you use Paste Append rather than Paste.
    Of course you can all this much more easily using an Append query. this would do all records in one go.
    Regards
    John



  5. #5
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    Leuven, Vlaanderen, Belgium
    Posts
    322
    Thanks
    9
    Thanked 0 Times in 0 Posts

    SOLVED - Re: Can't copy paste...

    John,
    indeed - thanks for the confirmation.
    An append query was one of the alternatives I was thinking about - now you mention it, I guess I can assume it's the best or at least way good enough way to go .
    I guess the easiest way is to (please correct me if I'm wrong):
    - create an append query selecting (through comparison with the 'normal' table) only records which are absent the backup "...Orig" table... and
    - execute this update query (when it contains records) at the subform's 'Deactivate' event (and not at the AfterUpdate event, as the latter would have it launched for every record that has been added).
    Thanks again!
    Hasse

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •