Data Entry Subform

  • Thread starter Thread starter Marin Kostov
  • Start date Start date
M

Marin Kostov

Open the Online Help and type BeforeUpdate. This will display you an
explanation and Example...

Here is the sample code.

Private Sub ProductName_BeforeUpdate(Cancel As Integer)
If(Not IsNull(DLookup("[ProductName]", _
"Products", "[ProductName] ='" _
& Me!ProductName & "'"))) Then
MsgBox "Product has already been entered in the database."
Cancel = True
Me!ProductName.Undo
End If
End Sub
 
Hello,

Could anyone help me please? I have a subform use as a data entry of
materials for a particular order number. The subform is set to 'continuous
form' as its default view. In the subform I have a "Before Update" event
that validates if the new entered material has been entered previously. If
ever the new material entered already exist it will display a notice or
message. What my problem is, I would like to automatically cancel the entry
made then go to the existing record to update.
 
Back
Top