R
Ray
Good day. I have a form with a command button that duplicates the current
record using the code below. It works if i open the form from the back end
but not if the form is opened on the frontend. On the front end i get the
message "You can't go to the specific record" and the recod is not duplicated.
Any suggestions on what i can do to correct this issue?
Dim strDeliverable1, strDeliverable2, strDeliverable3, strDeliverable4,
strDeliverable5 As String
Dim Null_Deliverable1 As String
Dim Null_Deliverable2 As String
Dim Null_Deliverable3 As String
Dim Null_Deliverable4 As String
Dim Null_Deliverable5 As String
If Not IsNull(Me![Deliverable1]) Or Me.Deliverable1 = "" Then
Null_Deliverable1 = False
Else
Null_Deliverable1 = True
End If
If Not IsNull(Me![Deliverable2]) Or Me.Deliverable2 = "" Then
Null_Deliverable2 = False
Else
Null_Deliverable2 = True
End If
If Not IsNull(Me![Deliverable3]) Or Me.Deliverable3 = "" Then
Null_Deliverable3 = False
Else
Null_Deliverable3 = True
End If
If Not IsNull(Me![Deliverable4]) Or Me.Deliverable4 = "" Then
Null_Deliverable4 = False
Else
Null_Deliverable4 = True
End If
If Not IsNull(Me![Deliverable5]) Or Me.Deliverable5 = "" Then
Null_Deliverable5 = False
Else
Null_Deliverable5 = True
End If
If Null_Deliverable1 = False Then strDeliverable1 = Me![Deliverable1]
If Null_Deliverable2 = False Then strDeliverable2 = Me![Deliverable2]
If Null_Deliverable3 = False Then strDeliverable3 = Me![Deliverable3]
If Null_Deliverable4 = False Then strDeliverable4 = Me![Deliverable4]
If Null_Deliverable5 = False Then strDeliverable5 = Me![Deliverable5]
DoCmd.GoToRecord , , acNewRec
If Null_Deliverable1 = False Then Me![Deliverable1] = strDeliverable1
If Null_Deliverable2 = False Then Me![Deliverable2] = strDeliverable2
If Null_Deliverable3 = False Then Me![Deliverable3] = strDeliverable3
If Null_Deliverable4 = False Then Me![Deliverable4] = strDeliverable4
If Null_Deliverable5 = False Then Me![Deliverable5] = strDeliverable5
strDeliverable1 = ""
strDeliverable2 = ""
strDeliverable3 = ""
strDeliverable4 = ""
strDeliverable5 = ""
Null_Deliverable1 = ""
Null_Deliverable2 = ""
Null_Deliverable3 = ""
Null_Deliverable4 = ""
Null_Deliverable5 = ""
record using the code below. It works if i open the form from the back end
but not if the form is opened on the frontend. On the front end i get the
message "You can't go to the specific record" and the recod is not duplicated.
Any suggestions on what i can do to correct this issue?
Dim strDeliverable1, strDeliverable2, strDeliverable3, strDeliverable4,
strDeliverable5 As String
Dim Null_Deliverable1 As String
Dim Null_Deliverable2 As String
Dim Null_Deliverable3 As String
Dim Null_Deliverable4 As String
Dim Null_Deliverable5 As String
If Not IsNull(Me![Deliverable1]) Or Me.Deliverable1 = "" Then
Null_Deliverable1 = False
Else
Null_Deliverable1 = True
End If
If Not IsNull(Me![Deliverable2]) Or Me.Deliverable2 = "" Then
Null_Deliverable2 = False
Else
Null_Deliverable2 = True
End If
If Not IsNull(Me![Deliverable3]) Or Me.Deliverable3 = "" Then
Null_Deliverable3 = False
Else
Null_Deliverable3 = True
End If
If Not IsNull(Me![Deliverable4]) Or Me.Deliverable4 = "" Then
Null_Deliverable4 = False
Else
Null_Deliverable4 = True
End If
If Not IsNull(Me![Deliverable5]) Or Me.Deliverable5 = "" Then
Null_Deliverable5 = False
Else
Null_Deliverable5 = True
End If
If Null_Deliverable1 = False Then strDeliverable1 = Me![Deliverable1]
If Null_Deliverable2 = False Then strDeliverable2 = Me![Deliverable2]
If Null_Deliverable3 = False Then strDeliverable3 = Me![Deliverable3]
If Null_Deliverable4 = False Then strDeliverable4 = Me![Deliverable4]
If Null_Deliverable5 = False Then strDeliverable5 = Me![Deliverable5]
DoCmd.GoToRecord , , acNewRec
If Null_Deliverable1 = False Then Me![Deliverable1] = strDeliverable1
If Null_Deliverable2 = False Then Me![Deliverable2] = strDeliverable2
If Null_Deliverable3 = False Then Me![Deliverable3] = strDeliverable3
If Null_Deliverable4 = False Then Me![Deliverable4] = strDeliverable4
If Null_Deliverable5 = False Then Me![Deliverable5] = strDeliverable5
strDeliverable1 = ""
strDeliverable2 = ""
strDeliverable3 = ""
strDeliverable4 = ""
strDeliverable5 = ""
Null_Deliverable1 = ""
Null_Deliverable2 = ""
Null_Deliverable3 = ""
Null_Deliverable4 = ""
Null_Deliverable5 = ""