I need a way to stop blank values from being pasted into my form/table. Simply, I'm copying and pasting a large group of text from Excel and in some cases there are blank values in the selection. I'd like something that recognized those values that are blank and skipped them and continued to execute the paste for the values.
Example data being selected.
Here's the current code that I want to modify.
Example data being selected.
Value 1 |
Blank/Null Value |
Value 2 |
Here's the current code that I want to modify.
Code:
Private Sub GFEBS_Role_BeforeUpdate(Cancel As Integer)
Dim ClickResult As VbMsgBoxResultEx
'check to make sure I have a specific system selected.
If IsNull(Forms!f_E2E!f_E2E_System_Relationship!System_ID) = True Then
ClickResult = Dialog.RichBox("You need to select a system to populate this record", vbOKOnly + vbCritical, "System Linkage", , , 0, False, False, False)
If ClickResult = vbOK Then
Me.Undo
End If
'Checks the make sure I'm not pasting in a duplicate record.
ElseIf DCount("*", "[t_E2E_GFEBS_Role_Relationship]", "[E2E_ID]= " & Me.[E2E_ID] & "and [System_ID]= " & Me.[System_ID] & " And [GFEBS_Role]= " & Chr(34) & Me![GFEBS_Role] & Chr(34)) > 0 Then
ClickResult = Dialog.RichBox("This is a duplicate record. " & "</p>" & _
"Click OK to remove it.", vbOKOnly + vbCritical, "Duplicate Entry", , , 0, False, False, False)
If ClickResult = vbOK Then
Me.Undo
End If
End If
End Sub
Last edited: