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 = "[Insurer]<>" & "'" & Me![LQ_InsID] & "'"
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 = "street"
stadd2.Value = "estate"
stadd3.Value = "town"
stadd4.Value = "county"
stpc.Value = "pc"
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..
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 = "[Insurer]<>" & "'" & Me![LQ_InsID] & "'"
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 = "street"
stadd2.Value = "estate"
stadd3.Value = "town"
stadd4.Value = "county"
stpc.Value = "pc"
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..