command copy is not available

Waldin

Registered User.
Local time
Today, 10:12
Joined
Oct 11, 2012
Messages
109
:banghead:if the command copy is'nt currently available , then what is available to perform the same task as COPY.
 
Where does this error come up, what were you trying to do? Is this the first time you have seen this?
 
im tryng to copy from a subform, and the field i'd like to copy from is based on a query.

im trying to copy so that i dont loose information upon editing the records using the code Eugin gave me a few days ago:
Private Sub Form_Dirty(Cancel As Integer)
DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdCopy
DoCmd.GoToRecord , , acNewRec
DoCmd.RunCommand acCmdPaste
the code works perfectly in forms but not in any of the subforms.

i've been trying to tackle this issue on my own but to no success.
 
What this code is looking at is just the record on the main form, if you have the same on a button in the subform then it should work for you. But that depends on how you have designed your subform is it like a datasheet or continuous form view or single form view.
 
It is in Continious form view, any guidelines?
 
If its in a continuous form then all records would be looked to be selected, so is it a particular record and does it have an id field in the continuous form?
 
it has an id field named ProductID and the ProductID field is generating this error, but its one of the fields that ussually gets edited so id like to copy the origional data (OnDirty) so the origional data isnt lost when edited

sorry i had to edit my reply
 
Last edited:
I had a similar Problem with the Copy function. On some PC it was working on others not. I notices that it was because of permition to the clipboard. Sometimes the same user had it and sometimes not. Because i´m copying only one record from my form that is currently open i made this code that uses SQL statement:

PHP:
Private Sub Befehl268_Click()
Dim Kundent, Kundenreft As Variant

Kundent = [Forms]![Dispoliste]![Kunden].Value
Kundenreft = [Forms]![Dispoliste]![Kundenref].Value

DoCmd.SetWarnings False

DoCmd.RunSQL "INSERT INTO DispolisteS " & _
            "( [Kunde],[Kundenref]" & _
            "VALUES (""" & Kundent & """,""" & Kundenreft & """)"
End Sub

The best thing of that is that you can select the records you want to copy so with that code i have something bether than just the Copy VBA code or Copy macro :D
 
Thanks, will this only work with selecting records individually, or can i apply it with the OnDirty Function?
 
That code makes the Copy. I think you can select the event you want that starts the code. I use On_click event with a button.
 
Marvellous, thanks a great deal Reflex...!
 

Users who are viewing this thread

Back
Top Bottom