Private Sub cod_material_BeforeUpdate(Cancel As Integer)
Dim cod_material As String
Dim MySQL As String, MyCriteria As String, MyRecordSource As String
If (Not IsNull(DLookup("[cod_material]", "tbl_estoque", _
"[Cod_Item_Obra]= '" & Me!cod_material & "'"))) Then
cod_material = Resumenext
Else
MsgBox " Material Inexistente ", _
vbKatakana, "Atenção"
Cancel = True
Me!cod_material.Undo
End If
End Sub
Dim cod_material As String
Dim MySQL As String, MyCriteria As String, MyRecordSource As String
If (Not IsNull(DLookup("[cod_material]", "tbl_estoque", _
"[Cod_Item_Obra]= '" & Me!cod_material & "'"))) Then
cod_material = Resumenext
Else
MsgBox " Material Inexistente ", _
vbKatakana, "Atenção"
Cancel = True
Me!cod_material.Undo
End If
End Sub