S
SF
Hi,
I have the following code to check for duplicate number. the code work when
there is an existing number. I got error when IDStg is null.
Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim Stg As String
Dim IDStg As String
IDStg = ""
IDStg = DLookup("Ck_ContractID", "msgDuplicateContract", "[Ck_ContractID]='"
& Me.Ck_ContractID & "'")
If Len(IDStg) > 1 Then
Stg = "Agreement Number: " & IDStg & " has been assigned to " & vbCr &
vbLf & DLookup("Location", "msgDuplicateContract", "[Ck_ContractID]='" &
Me.Ck_ContractID & "'") & vbCr & vbLf & "by " & DLookup("Owner",
"msgDuplicateContract", "[Ck_ContractID]='" & Me.Ck_ContractID & "'")
MsgBox Stg, vbOKOnly + vbInformation, "Found Duplicate FOG"
Me.Ck_ContractID.SetFocus
End If
End With
SF
I have the following code to check for duplicate number. the code work when
there is an existing number. I got error when IDStg is null.
Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim Stg As String
Dim IDStg As String
IDStg = ""
IDStg = DLookup("Ck_ContractID", "msgDuplicateContract", "[Ck_ContractID]='"
& Me.Ck_ContractID & "'")
If Len(IDStg) > 1 Then
Stg = "Agreement Number: " & IDStg & " has been assigned to " & vbCr &
vbLf & DLookup("Location", "msgDuplicateContract", "[Ck_ContractID]='" &
Me.Ck_ContractID & "'") & vbCr & vbLf & "by " & DLookup("Owner",
"msgDuplicateContract", "[Ck_ContractID]='" & Me.Ck_ContractID & "'")
MsgBox Stg, vbOKOnly + vbInformation, "Found Duplicate FOG"
Me.Ck_ContractID.SetFocus
End If
End With
SF