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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

duplicate button wizard

Status
Not open for further replies.

maudedo

MIS
Jul 10, 2003
41
GB
Hello
I have created a duplicate record button on a form, but when I click it, I get an error message 'command or action PasteAppend isn't available now'.

I am running Access97. I also have Access XP on my machine but runs from a partition drive.
Anyone have a clue on why this is happening?
or anyone have alternative code?

What I am actually trying to achieve, is if we receive a new client, and the documentation shows #empty as this client does not yet exist in the client table, then when they double click on the client in the main form, this will take them straight into the client table, and duplicate some of the fields from one client and they only have to type in the name and code, all of the address etc is automatically added into the client table....

the code i have started is as so.. but this doesn't work either..

Private Sub LQ_InsID_DblClick(Cancel As Integer)

Dim stDocName As String
Dim stLinkCriteria As String
Dim stInsID As String
Dim stinstel As String
Dim stinsfax As String
Dim stadd1 As String
Dim stadd2 As String
Dim stadd3 As String
Dim stadd4 As String
Dim stpc As String
Dim stclient As String
Dim sttelno As String
Dim stfaxno As String
Dim stinscl As String
Dim rst As Recordset
Dim fld As Field


stDocName = "frm_clients"
stinscl = [Insurer]
stInsID = LQ_InsID
stadd1 = [Insaddress1]
stadd2 = [Insaddress2]
stadd3 = [Insaddress3]
stadd4 = [Insaddress4]
stpc = [Inspostalcode]
stclient = client_type

If stclient = "Adjuster" Then stinstel = sttelno
If stclient = "Direct" Then stinstel = "012345678"
If stclient = "Adjuster" Then stinsfaxno = "012345677"
If stclient = "Direct" Then stinsfaxno = "0124345676"

stLinkCriteria = &quot;[Insurer]<>&quot; & &quot;'&quot; & Me![LQ_InsID] & &quot;'&quot;
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.GoToRecord , , acNewRec
' this is where i want to give values to the fields in the client table as soon as the new record is created
stinscl.Value = LQ_InsID
stadd1.Value = &quot;street&quot;
stadd2.Value = &quot;estate&quot;
stadd3.Value = &quot;town&quot;
stadd4.Value = &quot;county&quot;
stpc.Value = &quot;pc&quot;

End Sub

like i say, alternatively, i would like it to duplicate the client they double click on, and then nullify the code and name, for them to enter that data...

thanks in anticipation..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top